diff --git a/Grid/Grid_Eigen_Dense.h b/Grid/Grid_Eigen_Dense.h index cbe0a389..0295446e 100644 --- a/Grid/Grid_Eigen_Dense.h +++ b/Grid/Grid_Eigen_Dense.h @@ -5,48 +5,36 @@ #define EIGEN_USE_MKL_ALL #endif + #if defined __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif +/* NVCC save and restore compile environment*/ #ifdef __NVCC__ - #pragma push #pragma diag_suppress code_is_unreachable - -#define __NVCC__REDEFINE__ - +#pragma push_macro("__CUDA_ARCH__") +#pragma push_macro("__NVCC__") +#pragma push_macro("__CUDACC__") #undef __NVCC__ #undef __CUDACC__ - -#ifdef __CUDA_ARCH__ - -#define __CUDA_ARCH__REDEFINE__ 1 -#define __CUDA_ARCH_SAVE__ __CUDA_ARCH__ - #undef __CUDA_ARCH__ - -#endif - +#define __NVCC__REDEFINE__ #endif #include +/* NVCC restore */ #ifdef __NVCC__REDEFINE__ - +#pragma pop_macro("__CUDACC__") +#pragma pop_macro("__NVCC__") +#pragma pop_macro("__CUDA_ARCH__") #pragma pop - -#define __NVCC__ -#define __CUDACC__ - -#ifdef __CUDA_ARCH__REDEFINE__ - -#define __CUDA_ARCH__ __CUDA_ARCH_SAVE__ - -#endif #endif #if defined __GNUC__ #pragma GCC diagnostic pop #endif +