Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate a few CUB macros #3456

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cub/cub/util_macro.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,38 @@ CUB_NAMESPACE_BEGIN

#ifndef CUB_MAX
/// Select maximum(a, b)
/// Deprecated since [2.8]
# define CUB_MAX(a, b) (((b) > (a)) ? (b) : (a))
#endif

#ifndef CUB_MIN
/// Select minimum(a, b)
/// Deprecated since [2.8]
# define CUB_MIN(a, b) (((b) < (a)) ? (b) : (a))
#endif

#ifndef CUB_QUOTIENT_FLOOR
/// Quotient of x/y rounded down to nearest integer
/// Deprecated since [2.8]
# define CUB_QUOTIENT_FLOOR(x, y) ((x) / (y))
#endif

#ifndef CUB_QUOTIENT_CEILING
/// Quotient of x/y rounded up to nearest integer
/// Deprecated since [2.8]
// FIXME(bgruber): the following computation can overflow, use cuda::ceil_div instead
# define CUB_QUOTIENT_CEILING(x, y) (((x) + (y) - 1) / (y))
#endif

#ifndef CUB_ROUND_UP_NEAREST
/// x rounded up to the nearest multiple of y
/// Deprecated since [2.8]
# define CUB_ROUND_UP_NEAREST(x, y) (CUB_QUOTIENT_CEILING(x, y) * y)
#endif

#ifndef CUB_ROUND_DOWN_NEAREST
/// x rounded down to the nearest multiple of y
/// Deprecated since [2.8]
# define CUB_ROUND_DOWN_NEAREST(x, y) (((x) / (y)) * y)
#endif

Expand Down
Loading