aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-12 18:18:35 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-12 18:18:35 -0800
commite4d45f3440013666eb26860a7912e6d7e594ee6c (patch)
tree12c844c687128a30355941a85f472db3c92e1bf6
parent150c12e138ab372d7f43ce19b260acd36ede9fc3 (diff)
Only enable the use of const expression when nvcc is called with the -std=c++11 option
-rw-r--r--Eigen/src/Core/util/Macros.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 9540c0330..f4034ebdb 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -353,8 +353,10 @@
// Does the compiler support const expressions?
#ifdef __CUDACC__
-#define EIGEN_HAS_CONSTEXPR 1
- // Const expressions are not supported regardless of what host compiler is used
+// Const expressions are supported provided that c++11 is enabled
+#if __cplusplus > 199711L
+ #define EIGEN_HAS_CONSTEXPR 1
+#endif
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \
EIGEN_GNUC_AT_LEAST(4,8)
#define EIGEN_HAS_CONSTEXPR 1