3939#include < limits>
4040#include < type_traits>
4141
42- #if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !_NVHPC_CUDA
42+ #include < cuda.h>
43+
44+ #if !_NVHPC_CUDA
4345 #include < cuda_fp16.h>
4446#endif
45- #if (__CUDACC_VER_MAJOR__ >= 11 || CUDA_VERSION >= 11000) && !_NVHPC_CUDA && \
46- !defined (CUB_DISABLE_BF16_SUPPORT)
47- #include < cuda_bf16.h>
47+ #if !_NVHPC_CUDA && !defined(CUB_DISABLE_BF16_SUPPORT)
48+ #include < cuda_bf16.h>
4849#endif
4950
5051#include < cub/detail/uninitialized_copy.cuh>
@@ -62,7 +63,7 @@ CUB_NAMESPACE_BEGIN
6263#define CUB_IS_INT128_ENABLED 1
6364#endif // !defined(__CUDACC_RTC_INT128__)
6465#else // !defined(__CUDACC_RTC__)
65- #if (__CUDACC_VER_MAJOR__ >= 11 || CUDA_VERSION >= 11050)
66+ #if CUDA_VERSION >= 11050
6667#if (CUB_HOST_COMPILER == CUB_HOST_COMPILER_GCC) || \
6768 (CUB_HOST_COMPILER == CUB_HOST_COMPILER_CLANG) || \
6869 defined (__ICC) || defined(_NVHPC_CUDA)
@@ -1107,7 +1108,7 @@ struct FpLimits<double>
11071108 }
11081109};
11091110
1110- #if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !_NVHPC_CUDA
1111+ #if !_NVHPC_CUDA
11111112template <>
11121113struct FpLimits <__half>
11131114{
@@ -1123,8 +1124,7 @@ struct FpLimits<__half>
11231124};
11241125#endif
11251126
1126- #if (__CUDACC_VER_MAJOR__ >= 11 || CUDA_VERSION >= 11000) && !_NVHPC_CUDA && \
1127- !defined (CUB_DISABLE_BF16_SUPPORT)
1127+ #if !_NVHPC_CUDA && !defined(CUB_DISABLE_BF16_SUPPORT)
11281128template <>
11291129struct FpLimits <__nv_bfloat16>
11301130{
@@ -1278,11 +1278,10 @@ struct NumericTraits<__int128_t>
12781278
12791279template <> struct NumericTraits <float > : BaseTraits<FLOATING_POINT, true , false , unsigned int , float > {};
12801280template <> struct NumericTraits <double > : BaseTraits<FLOATING_POINT, true , false , unsigned long long , double > {};
1281- #if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !_NVHPC_CUDA
1281+ #if !_NVHPC_CUDA
12821282 template <> struct NumericTraits <__half> : BaseTraits<FLOATING_POINT, true , false , unsigned short , __half> {};
12831283#endif
1284- #if (__CUDACC_VER_MAJOR__ >= 11 || CUDA_VERSION >= 11000) && !_NVHPC_CUDA && \
1285- !defined (CUB_DISABLE_BF16_SUPPORT)
1284+ #if !_NVHPC_CUDA && !defined(CUB_DISABLE_BF16_SUPPORT)
12861285 template <> struct NumericTraits <__nv_bfloat16> : BaseTraits<FLOATING_POINT, true , false , unsigned short , __nv_bfloat16> {};
12871286#endif
12881287
0 commit comments