diff options
Diffstat (limited to 'Eigen/src/Core/util')
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 0c2882589..d4f91a905 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -668,6 +668,17 @@ #endif #endif +// Does the compiler support std::hash? +#ifndef EIGEN_HAS_STD_HASH +// The std::hash struct is defined in C++11 but is not labelled as a __device__ +// function and is not constexpr, so cannot be used on device. +#if EIGEN_HAS_CXX11 && !EIGEN_GPU_COMPILE_PHASE +#define EIGEN_HAS_STD_HASH 1 +#else +#define EIGEN_HAS_STD_HASH 0 +#endif +#endif // EIGEN_HAS_STD_HASH + #ifndef EIGEN_HAS_ALIGNAS #if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \ ( __has_feature(cxx_alignas) \ |