33 #ifndef OPM_GPUDECORATORS_HPP 34 #define OPM_GPUDECORATORS_HPP 38 #pragma nv_diag_suppress 20011,20014 44 #if defined(__NVCC__) || defined(__HIPCC__) 45 #define OPM_IS_COMPILING_WITH_GPU_COMPILER 1 47 #define OPM_IS_COMPILING_WITH_GPU_COMPILER 0 51 #if defined(__CUDA_ARCH__) || (defined(__HIP_DEVICE_COMPILE__) && __HIP_DEVICE_COMPILE__ > 0) 52 #define OPM_IS_INSIDE_DEVICE_FUNCTION 1 53 #define OPM_IS_INSIDE_HOST_FUNCTION 0 55 #define OPM_IS_INSIDE_DEVICE_FUNCTION 0 56 #define OPM_IS_INSIDE_HOST_FUNCTION 1 59 #if HAVE_CUDA // if we will compile with GPU support 62 #if USE_HIP // use HIP if we compile for AMD architectures 63 #include <hip/hip_runtime.h> 64 #else // otherwise include cuda 65 #include <cuda_runtime.h> 68 #define OPM_HOST_DEVICE __device__ __host__ 69 #define OPM_DEVICE __device__ 70 #define OPM_HOST __host__ 71 #define OPM_IS_USING_GPU 1 73 #define OPM_HOST_DEVICE 76 #define OPM_IS_USING_GPU 0 79 #endif // END HEADER GUARD