diff --git a/c2h/generators.cu b/c2h/generators.cu index 8044eabe6fe..771cc234c90 100644 --- a/c2h/generators.cu +++ b/c2h/generators.cu @@ -40,7 +40,7 @@ #include #include -#include +#include #include @@ -118,30 +118,7 @@ private: c2h::device_vector m_distribution; }; -// TODO(bgruber): modelled after cub::Traits. We should generalize this somewhere into libcu++. -template -struct is_floating_point : ::cuda::std::is_floating_point -{}; -#ifdef _CCCL_HAS_NVFP16 -template <> -struct is_floating_point<__half> : ::cuda::std::true_type -{}; -#endif // _CCCL_HAS_NVFP16 -#ifdef _CCCL_HAS_NVBF16 -template <> -struct is_floating_point<__nv_bfloat16> : ::cuda::std::true_type -{}; -#endif // _CCCL_HAS_NVBF16 -#ifdef __CUDA_FP8_TYPES_EXIST__ -template <> -struct is_floating_point<__nv_fp8_e4m3> : ::cuda::std::true_type -{}; -template <> -struct is_floating_point<__nv_fp8_e5m2> : ::cuda::std::true_type -{}; -#endif // __CUDA_FP8_TYPES_EXIST__ - -template ::value> +template > struct random_to_item_t { float m_min; diff --git a/c2h/include/c2h/bfloat16.cuh b/c2h/include/c2h/bfloat16.cuh index b7598562715..77701936bca 100644 --- a/c2h/include/c2h/bfloat16.cuh +++ b/c2h/include/c2h/bfloat16.cuh @@ -211,6 +211,10 @@ struct bfloat16_t } }; +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + /****************************************************************************** * I/O stream overloads ******************************************************************************/ @@ -229,28 +233,28 @@ inline std::ostream& operator<<(std::ostream& out, const __nv_bfloat16& x) } /****************************************************************************** - * Traits overloads + * limits ******************************************************************************/ +_LIBCUDACXX_BEGIN_NAMESPACE_STD template <> -struct CUB_NS_QUALIFIER::FpLimits +class numeric_limits { - static __host__ __device__ __forceinline__ bfloat16_t Max() +public: + static __host__ __device__ __forceinline__ bfloat16_t max() { return bfloat16_t::max(); } - static __host__ __device__ __forceinline__ bfloat16_t Lowest() + static __host__ __device__ __forceinline__ bfloat16_t lowest() { return bfloat16_t::lowest(); } }; +_LIBCUDACXX_END_NAMESPACE_STD template <> -struct CUB_NS_QUALIFIER::NumericTraits - : CUB_NS_QUALIFIER::BaseTraits -{}; - -#ifdef __GNUC__ -# pragma GCC diagnostic pop -#endif +struct CUB_NS_QUALIFIER::detail::unsigned_bits +{ + using type = unsigned short; +}; diff --git a/c2h/include/c2h/custom_type.h b/c2h/include/c2h/custom_type.h index ddbceef388a..e8759481eec 100644 --- a/c2h/include/c2h/custom_type.h +++ b/c2h/include/c2h/custom_type.h @@ -178,13 +178,12 @@ class accumulateable_t } // namespace c2h -namespace std -{ +_LIBCUDACXX_BEGIN_NAMESPACE_STD template