aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 17:58:32 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 17:58:32 -0700
commitbc68fc2fe73adba1cf4d0b40d99d201c3f12bb64 (patch)
tree74a3cf89363b86b5bf13fd664e21ade2fc3638d2 /Eigen
parent483aaad10a925b5b22ea87bcabe01712db4fe870 (diff)
Enable constant expressions when compiling cuda code with clang.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/util/Macros.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index dbfc9bd37..97627d14c 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -370,8 +370,8 @@
// Does the compiler support const expressions?
#ifdef __CUDACC__
-// Const expressions are supported provided that c++11 is enabled and we're using nvcc 7.5 or above
-#if defined(__CUDACC_VER__) && __CUDACC_VER__ >= 70500 && __cplusplus > 199711L
+// Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
+#if __cplusplus > 199711L && defined(__CUDACC_VER__) && (defined(__clang__) || __CUDACC_VER__ >= 70500)
#define EIGEN_HAS_CONSTEXPR 1
#endif
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \