aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-08-24 11:26:41 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-08-24 11:26:41 +0200
commit304ef2957134be386e50592ad7120177c5f3a7c0 (patch)
tree92a732ba402403b81e6761cbcace008998b0b580 /test/main.h
parent21633e585b61564159d9cfbfbbad9006b8a09d64 (diff)
Handle min/max/inf/etc issue in cuda_fp16.h directly in test/main.h
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/main.h b/test/main.h
index bd5325196..429c44f81 100644
--- a/test/main.h
+++ b/test/main.h
@@ -50,6 +50,19 @@
#endif
#endif
+// Same for cuda_fp16.h
+#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
+#define EIGEN_TEST_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
+#elif defined(__CUDACC_VER__)
+#define EIGEN_TEST_CUDACC_VER __CUDACC_VER__
+#else
+#define EIGEN_TEST_CUDACC_VER 0
+#endif
+
+#if EIGEN_TEST_CUDACC_VER >= 70500
+#include <cuda_fp16.h>
+#endif
+
// To test that all calls from Eigen code to std::min() and std::max() are
// protected by parenthesis against macro expansion, the min()/max() macros
// are defined here and any not-parenthesized min/max call will cause a