aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 17:59:49 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-03-30 17:59:49 -0700
commit4f1a7e51c17586487c986a456e39af40b41bf4b4 (patch)
tree3ec04e6eeb2a287d6d6968ea6c033ff006084a62 /Eigen
parentbc68fc2fe73adba1cf4d0b40d99d201c3f12bb64 (diff)
Pull math functions from the global namespace only when compiling cuda code with nvcc. When compiling with clang, we want to use the std namespace.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/Core5
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/Core b/Eigen/Core
index 8428c51e4..24799f32b 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -42,7 +42,10 @@
#endif
-#if defined(__CUDA_ARCH__)
+// When compiling CUDA device code with NVCC, pull in math functions from the
+// global namespace. In host mode, and when device doee with clang, use the
+// std versions.
+#if defined(__CUDA_ARCH__) && defined(__NVCC__)
#define EIGEN_USING_STD_MATH(FUNC) using ::FUNC;
#else
#define EIGEN_USING_STD_MATH(FUNC) using std::FUNC;