Grid 0.7.0
Grid_Eigen_Dense.h
Go to the documentation of this file.
1#include <Grid/GridCore.h>
2#pragma once
3// Force Eigen to use MKL if Grid has been configured with --enable-mkl
4#ifdef USE_MKL
5#define EIGEN_USE_MKL_ALL
6#endif
7
8
9#if defined __GNUC__
10#pragma GCC diagnostic push
11#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
12#endif
13
14/* NVCC save and restore compile environment*/
15#ifdef __NVCC__
16#pragma push
17#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
18#pragma nv_diag_suppress code_is_unreachable
19#else
20#pragma diag_suppress code_is_unreachable
21#endif
22#pragma push_macro("__CUDA_ARCH__")
23#pragma push_macro("__NVCC__")
24#pragma push_macro("__CUDACC__")
25#undef __CUDA_ARCH__
26#undef __NVCC__
27#undef __CUDACC__
28#define __NVCC__REDEFINE__
29#endif
30
31/* SYCL save and restore compile environment*/
32#ifdef GRID_SYCL
33#pragma push
34#pragma push_macro("__SYCL_DEVICE_ONLY__")
35#undef __SYCL_DEVICE_ONLY__
36#define EIGEN_DONT_VECTORIZE
37#undef EIGEN_USE_SYCL
38#define __SYCL__REDEFINE__
39#endif
40
41/* HIP save and restore compile environment*/
42#ifdef GRID_HIP
43#pragma push
44#pragma push_macro("__HIP_DEVICE_COMPILE__")
45#endif
46#define EIGEN_NO_HIP
47
48#include <Grid/Eigen/Dense>
49#include <Grid/Eigen/unsupported/CXX11/Tensor>
50
51/* NVCC restore */
52#ifdef __NVCC__REDEFINE__
53#pragma pop_macro("__CUDACC__")
54#pragma pop_macro("__NVCC__")
55#pragma pop_macro("__CUDA_ARCH__")
56#pragma pop
57#endif
58
59/*SYCL restore*/
60#ifdef __SYCL__REDEFINE__
61#pragma pop_macro("__SYCL_DEVICE_ONLY__")
62#pragma pop
63#endif
64
65/*HIP restore*/
66#ifdef __HIP__REDEFINE__
67#pragma pop_macro("__HIP_DEVICE_COMPILE__")
68#pragma pop
69#endif
70
71#if defined __GNUC__
72#pragma GCC diagnostic pop
73#endif
74
75