diff --git a/lib/Grid_Eigen_Dense.h b/lib/Grid_Eigen_Dense.h index ac9fae02..0c0aec13 100644 --- a/lib/Grid_Eigen_Dense.h +++ b/lib/Grid_Eigen_Dense.h @@ -6,25 +6,42 @@ #endif #ifdef __NVCC__ + #pragma push #pragma diag_suppress code_is_unreachable + +#define __NVCC__REDEFINE__ + #undef __NVCC__ #undef __CUDACC__ + #ifdef __CUDA_ARCH__ -#define __CUDA_ARCH__REDEFINE__ + +#define __CUDA_ARCH__REDEFINE__ 1 +#define __CUDA_ARCH_SAVE__ __CUDA_ARCH__ + #undef __CUDA_ARCH__ +#warning "Hiding CUDA_ARCH from Eigen" + #endif + #endif #include -#ifdef __NVCC__ +#ifdef __NVCC__REDEFINE__ + #pragma pop + #define __NVCC__ #define __CUDACC__ #ifdef __CUDA_ARCH__REDEFINE__ -#define __CUDA_ARCH__ + +#define __CUDA_ARCH__ __CUDA_ARCH_SAVE__ + +#warning "redefined CUDA_ARCH outside Eigen" + #endif #endif