hipCUB CCCL 3.0.3 updates#
Changes have been made to hipCUB to achieve parity with CCCL 3.0.3, establish a hard dependency on libhipcxx, and align with the changes made in CUB.
hipCUB traits#
A new standard type traits system is now provided by libhipcxx and libcudacxx. Because of this the functionality and internal use of hipcub::Traits has been minimized. hipcub::Traits is now only used in hipCUB’s radix sort implementation for bit-twiddling.
hipcub::BaseTraits and hipcub::Traits can no longer be specialized for custom types. hipcub::FpLimits has been removed.
Classification of types should be done using the functionality in the hip/std/type_traits and hip/type_traits header files.
Floating-point limits should be obtained using hip::std::numeric_limits<T> instead of hipcub::FpLimits<T>.
hip::std::is_floating_point{_v} only recognizes C++ standard floating point types. hip::is_floating_point{_v} must be used to correctly classify extended types such as __half and hip_bfloat16.
Users can still specialize hipcub::NumericTraits for custom floating point types, inheriting from hipcub::BaseTraits and providing the necessary type information. The traits from libcu++ must also be specialized. For example, a custom floating point type my_half can be registered with hipCUB and libcu++ as follows:
template <>
inline constexpr bool ::hip::is_floating_point<my_half>::value = true;
template <>
class ::hip::std::numeric_limits<my_half> {
public:
static constexpr bool is_specialized = true;
static __host__ __device__ my_half max() { return /* TODO */; }
static __host__ __device__ my_half min() { return /* TODO */; }
static __host__ __device__ my_half lowest() { return /* TODO */; }
};
template <>
struct ::hipcub::NumericTraits<my_half> : ::hipcub::BaseTraits<FLOATING_POINT, true, uint16_t, my_half> {};
Removed macros#
Macro |
Migration guidance |
|---|---|
|
Use |
|
No replacement. |
|
Use |
|
Use |
|
Use |
|
Use plain integer division |
|
Use |
|
No replacement. |
Removed functions and classes#
API |
Migration guidance |
|---|---|
|
No replacement. |
|
No replacement. |
|
No replacement. |
|
Use the functionality available in |
|
No replacement. |
|
Use the functionality available in |
|
Use |
|
Use |
|
Use |
|
Use hipSPARSE instead. |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use the APIs from cooperative groups instead. |
|
Use the APIs from cooperative groups instead. |
|
No replacement. |
|
Use |
|
Use |
|
No replacement. |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
No replacement. |
|
No replacement. |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
|
Use |
Deprecations with planned removal#
hipcub::Traits<T>::Max() has been deprecated and will be removed in a later version. Users are encouraged to use hip::std::numeric_limits<T>::max() instead.
Other changes#
hipcub::DeviceReduce::{Arg}[Max|Min] now uses hip::std::numeric_limits<T>::[max|min]() instead of hipcub::Traits to determine the initial value.