Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Fix cub/util_type.cuh to not use 16-bit float with NVC++ #233

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
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: 3 additions & 3 deletions cub/util_type.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <limits>
#include <cfloat>

#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
#include <cuda_fp16.h>
#endif

Expand Down Expand Up @@ -1063,7 +1063,7 @@ struct FpLimits<double>
};


#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
template <>
struct FpLimits<__half>
{
Expand Down Expand Up @@ -1143,7 +1143,7 @@ template <> struct NumericTraits<unsigned long long> : BaseTraits<UNSIGNED_INTE

template <> struct NumericTraits<float> : BaseTraits<FLOATING_POINT, true, false, unsigned int, float> {};
template <> struct NumericTraits<double> : BaseTraits<FLOATING_POINT, true, false, unsigned long long, double> {};
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
template <> struct NumericTraits<__half> : BaseTraits<FLOATING_POINT, true, false, unsigned short, __half> {};
#endif

Expand Down
8 changes: 4 additions & 4 deletions test/test_device_radix_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <algorithm>
#include <typeinfo>

#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
#include <cuda_fp16.h>
#endif

Expand Down Expand Up @@ -733,7 +733,7 @@ void Test(
ValueT *h_reference_values)
{
// Key alias type
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
typedef typename If<Equals<KeyT, half_t>::VALUE, __half, KeyT>::Type KeyAliasT;
#else
typedef KeyT KeyAliasT;
Expand Down Expand Up @@ -1240,7 +1240,7 @@ int main(int argc, char** argv)

printf("\n-------------------------------\n");

#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
Test<CUB, half_t, NullType, IS_DESCENDING>(num_items, 1, RANDOM, entropy_reduction, 0, bits);
#endif
Test<CUB, float, NullType, IS_DESCENDING>(num_items, 1, RANDOM, entropy_reduction, 0, bits);
Expand Down Expand Up @@ -1299,7 +1299,7 @@ int main(int argc, char** argv)
TestGen<long long> (num_items, num_segments);
TestGen<unsigned long long> (num_items, num_segments);

#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000)
#if (__CUDACC_VER_MAJOR__ >= 9 || CUDA_VERSION >= 9000) && !__NVCOMPILER_CUDA__
TestGen<half_t> (num_items, num_segments);
#endif
TestGen<float> (num_items, num_segments);
Expand Down