From 69327db9a96b08eee8730905e14715dab307138e Mon Sep 17 00:00:00 2001 From: paboyle Date: Wed, 24 Jan 2018 13:25:07 +0000 Subject: [PATCH] Improviements for NVCC. Eigen is not compat with CUDA 9 and must hack to disable device compilation --- lib/GridCore.h | 5 +++-- lib/Grid_Eigen_Dense.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/GridCore.h b/lib/GridCore.h index 5fab4c71..cc1811af 100644 --- a/lib/GridCore.h +++ b/lib/GridCore.h @@ -38,16 +38,17 @@ Author: paboyle #ifndef GRID_BASE_H #define GRID_BASE_H +#include #include #include - +#include #include #include #include #include #include -#include #include +#include #include #include #include diff --git a/lib/Grid_Eigen_Dense.h b/lib/Grid_Eigen_Dense.h index 4fb5b831..05a3d791 100644 --- a/lib/Grid_Eigen_Dense.h +++ b/lib/Grid_Eigen_Dense.h @@ -1,9 +1,27 @@ +#include #pragma once #if defined __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif + +#ifdef GRID_NVCC +#pragma push +#pragma diag_suppress code_is_unreachable +#undef __NVCC__ +#undef __CUDACC__ +#undef __CUDA_ARCH__ +#endif + #include + +#ifdef GRID_NVCC +#pragma pop +#define __NVCC__ +#define __CUDACC__ +#define __CUDA_ARCH__ +#endif + #if defined __GNUC__ #pragma GCC diagnostic pop #endif