Skip to content

Commit

Permalink
Deprecate a few CUB macros (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber authored Jan 21, 2025
1 parent df1f722 commit 32f41dd
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 32f41dd

Please sign in to comment.