-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-25.02' into high-lvl-comp-api
- Loading branch information
Showing
64 changed files
with
672 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Copyright 2019 BlazingDB, Inc. | ||
* Copyright 2019 Eyal Rozenberg <[email protected]> | ||
* Copyright (c) 2020-2024, NVIDIA CORPORATION. | ||
* Copyright (c) 2020-2025, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -23,6 +23,8 @@ | |
*/ | ||
|
||
#include <cudf/fixed_point/temporary.hpp> | ||
#include <cudf/types.hpp> | ||
#include <cudf/utilities/error.hpp> | ||
|
||
#include <cmath> | ||
#include <cstdlib> | ||
|
@@ -44,13 +46,17 @@ namespace util { | |
* `modulus` is positive. The safety is in regard to rollover. | ||
*/ | ||
template <typename S> | ||
constexpr S round_up_safe(S number_to_round, S modulus) | ||
CUDF_HOST_DEVICE constexpr S round_up_safe(S number_to_round, S modulus) | ||
{ | ||
auto remainder = number_to_round % modulus; | ||
if (remainder == 0) { return number_to_round; } | ||
auto rounded_up = number_to_round - remainder + modulus; | ||
if (rounded_up < number_to_round) { | ||
throw std::invalid_argument("Attempt to round up beyond the type's maximum value"); | ||
#ifndef __CUDA_ARCH__ | ||
CUDF_FAIL("Attempt to round up beyond the type's maximum value", cudf::data_type_error); | ||
#else | ||
CUDF_UNREACHABLE("Attempt to round up beyond the type's maximum value"); | ||
#endif | ||
} | ||
return rounded_up; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.