Closed jeffhammond closed 1 year ago
NVC++ supports CUDA, although it is not 100% compatible with NVCC due to C++ legalese.
The following is the required source code change for Thrust. I assume the one for CUDA is similar.
There also need to be CMake changes, to add the -cuda flag and recognize -DCMAKE_CUDA_COMPILER=nvc++.
-cuda
-DCMAKE_CUDA_COMPILER=nvc++
index 3a57ab0..f15a392 100644 --- a/src/thrust/ThrustStream.cu +++ b/src/thrust/ThrustStream.cu @@ -145,7 +145,7 @@ T ThrustStream<T>::dot() #if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA || \ (defined(THRUST_DEVICE_SYSTEM_HIP) && THRUST_DEVICE_SYSTEM_HIP == THRUST_DEVICE_SYSTEM) -#ifdef __NVCC__ +#if defined(__NVCC__) || defined(__NVCOMPILER_CUDA__) #define IMPL_FN__(fn) cuda ## fn #define IMPL_TYPE__(tpe) cuda ## tpe #elif defined(__HIP_PLATFORM_HCC__)
NVC++ supports CUDA, although it is not 100% compatible with NVCC due to C++ legalese.
The following is the required source code change for Thrust. I assume the one for CUDA is similar.
There also need to be CMake changes, to add the
-cuda
flag and recognize-DCMAKE_CUDA_COMPILER=nvc++
.