From 06eb24cf4d7d54e56abfb37ea062a7cb0c887550 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 13 Jul 2018 16:04:27 +0200 Subject: Introduce gpu_assert for assertion in device-code, and disable them with clang-cuda. --- unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h b/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h index 9966955f7..5438ebe71 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h @@ -78,10 +78,11 @@ #endif -#if defined(EIGEN_HIP_DEVICE_COMPILE) -// HIPCC does not support the use of assert on the GPU side. -#undef assert -#define assert(COND) +#if defined(EIGEN_HIP_DEVICE_COMPILE) || (defined(EIGEN_CUDACC) && (EIGEN_CUDACC_VER==0)) +// clang-cuda and HIPCC do not support the use of assert on the GPU side. +#define gpu_assert(COND) +#else +#define gpu_assert(COND) assert(COND) #endif #endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H -- cgit v1.2.3