1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

Cleaner drop from CUDA mode around Eigen includes. Remains difficult to let Eigen compile under nvcc with version issues.

This commit is contained in:
Peter Boyle 2019-01-01 13:39:10 +00:00
parent 231b61d012
commit 9efcc535bc

View File

@ -5,48 +5,36 @@
#define EIGEN_USE_MKL_ALL #define EIGEN_USE_MKL_ALL
#endif #endif
#if defined __GNUC__ #if defined __GNUC__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
/* NVCC save and restore compile environment*/
#ifdef __NVCC__ #ifdef __NVCC__
#pragma push #pragma push
#pragma diag_suppress code_is_unreachable #pragma diag_suppress code_is_unreachable
#pragma push_macro("__CUDA_ARCH__")
#define __NVCC__REDEFINE__ #pragma push_macro("__NVCC__")
#pragma push_macro("__CUDACC__")
#undef __NVCC__ #undef __NVCC__
#undef __CUDACC__ #undef __CUDACC__
#ifdef __CUDA_ARCH__
#define __CUDA_ARCH__REDEFINE__ 1
#define __CUDA_ARCH_SAVE__ __CUDA_ARCH__
#undef __CUDA_ARCH__ #undef __CUDA_ARCH__
#define __NVCC__REDEFINE__
#endif
#endif #endif
#include <Grid/Eigen/Dense> #include <Grid/Eigen/Dense>
/* NVCC restore */
#ifdef __NVCC__REDEFINE__ #ifdef __NVCC__REDEFINE__
#pragma pop_macro("__CUDACC__")
#pragma pop_macro("__NVCC__")
#pragma pop_macro("__CUDA_ARCH__")
#pragma pop #pragma pop
#define __NVCC__
#define __CUDACC__
#ifdef __CUDA_ARCH__REDEFINE__
#define __CUDA_ARCH__ __CUDA_ARCH_SAVE__
#endif
#endif #endif
#if defined __GNUC__ #if defined __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif