diff --git a/Grid/Grid_Eigen_Dense.h b/Grid/Grid_Eigen_Dense.h index d7119358..3aec81b6 100644 --- a/Grid/Grid_Eigen_Dense.h +++ b/Grid/Grid_Eigen_Dense.h @@ -12,25 +12,26 @@ #endif /* NVCC save and restore compile environment*/ -#ifdef __NVCC__ +#ifdef GRID_CUDA #pragma push #pragma diag_suppress code_is_unreachable -#pragma push_macro("GRID_SIMT") +#pragma push_macro("__CUDA_ARCH__") #pragma push_macro("__NVCC__") #pragma push_macro("__CUDACC__") +#undef __CUDA_ARCH__ #undef __NVCC__ #undef __CUDACC__ -#undef GRID_SIMT #define __NVCC__REDEFINE__ #endif /* SYCL save and restore compile environment*/ -#ifdef __SYCL_DEVICE_ONLY__ +#ifdef GRID_SYCL #pragma push #pragma push_macro("__SYCL_DEVICE_ONLY__") #undef __SYCL_DEVICE_ONLY__ -#undef EIGEN_USE_SYCL #define EIGEN_DONT_VECTORIZE +//#undef EIGEN_USE_SYCL +#define __SYCL__REDEFINE__ #endif diff --git a/Grid/threads/Accelerator.h b/Grid/threads/Accelerator.h index dc854388..ec20d8c9 100644 --- a/Grid/threads/Accelerator.h +++ b/Grid/threads/Accelerator.h @@ -73,6 +73,10 @@ void acceleratorThreads(uint32_t); ////////////////////////////////////////////// // CUDA acceleration ////////////////////////////////////////////// +#ifdef __NVCC__ +#define GRID_CUDA +#endif + #ifdef GRID_CUDA #ifdef __CUDA_ARCH__ @@ -114,7 +118,7 @@ inline void *acceleratorAllocShared(size_t bytes) void *ptr=NULL; auto err = cudaMallocManaged((void **)&ptr,bytes); if( err != cudaSuccess ) { - ptr = (_Tp *) NULL; + ptr = (void *) NULL; printf(" cudaMallocManaged failed for %d %s \n",bytes,cudaGetErrorString(err)); } return ptr; @@ -124,7 +128,7 @@ inline void *acceleratorAllocDevice(size_t bytes) void *ptr=NULL; auto err = cudaMalloc((void **)&ptr,bytes); if( err != cudaSuccess ) { - ptr = (_Tp *) NULL; + ptr = (void *) NULL; printf(" cudaMalloc failed for %d %s \n",bytes,cudaGetErrorString(err)); } return ptr; @@ -232,7 +236,7 @@ inline void *acceleratorAllocShared(size_t bytes) void *ptr=NULL; auto err = hipMallocManaged((void **)&ptr,bytes); if( err != hipSuccess ) { - ptr = (_Tp *) NULL; + ptr = (void *) NULL; printf(" hipMallocManaged failed for %d %s \n",bytes,hipGetErrorString(err)); } return ptr; @@ -242,7 +246,7 @@ inline void *acceleratorAllocDevice(size_t bytes) void *ptr=NULL; auto err = hipMalloc((void **)&ptr,bytes); if( err != hipSuccess ) { - ptr = (_Tp *) NULL; + ptr = (void *) NULL; printf(" hipMalloc failed for %d %s \n",bytes,hipGetErrorString(err)); } return ptr;