From b35401b86b1893afe7a538423c06dba8088e60ed Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Mon, 23 Jul 2018 06:09:33 -0400 Subject: [PATCH] Fix CUDA_ARCH. Need to simplify. See when new eigen release happens --- lib/Grid_Eigen_Dense.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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