Skip to content

Commit 2d0a743

Browse files
committed
In the near future, nvc++ -stdpar will be changed to no longer predefine the macro __CUDACC__. Adjust the uses of __CUDACC__ in Thrust and CUB to check for NVC++'s stdpar mode in addition to the __CUDACC__.
1 parent c38c6f9 commit 2d0a743

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

thrust/detail/complex/c99math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ __host__ __device__ inline float copysignf(float x, float y){
140140

141141

142142

143-
#ifndef __CUDACC__
143+
#if !defined(__CUDACC__) && !defined(__NVCOMPILER_CUDA__)
144144

145145
// Simple approximation to log1p as Visual Studio is lacking one
146146
inline double log1p(double x){

thrust/detail/config/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#endif // THRUST_HOST_COMPILER
5656

5757
// figure out which device compiler we're using
58-
#if defined(__CUDACC__)
58+
#if defined(__CUDACC__) || defined(__NVCOMPILER_CUDA__)
5959
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
6060
#elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC
6161
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC

thrust/detail/config/forceinline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <thrust/detail/config.h>
2424

25-
#if defined(__CUDACC__)
25+
#if defined(__CUDACC__) || defined(__NVCOMPILER_CUDA__)
2626

2727
#define __thrust_forceinline__ __forceinline__
2828

thrust/system/cuda/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#include <thrust/detail/config.h>
3030

31-
#if defined(__CUDACC__)
31+
#if defined(__CUDACC__) || defined(__NVCOMPILER_CUDA__)
3232
# if !defined(__CUDA_ARCH__) || (__CUDA_ARCH__>= 350 && defined(__CUDACC_RDC__))
3333
# define __THRUST_HAS_CUDART__ 1
3434
# define THRUST_RUNTIME_FUNCTION __host__ __device__ __forceinline__

0 commit comments

Comments
 (0)