aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gpu_common.h9
-rw-r--r--test/main.h16
2 files changed, 15 insertions, 10 deletions
diff --git a/test/gpu_common.h b/test/gpu_common.h
index 79d4ea694..fd8278f67 100644
--- a/test/gpu_common.h
+++ b/test/gpu_common.h
@@ -1,4 +1,3 @@
-
#ifndef EIGEN_TEST_GPU_COMMON_H
#define EIGEN_TEST_GPU_COMMON_H
@@ -130,10 +129,14 @@ void ei_test_init_gpu()
std::cout << " EIGEN_CUDACC: " << int(EIGEN_CUDACC) << "\n";
#endif
- #ifdef EIGEN_CUDACC_VER
- std::cout << " EIGEN_CUDACC_VER: " << int(EIGEN_CUDACC_VER) << "\n";
+ #ifdef EIGEN_CUDA_SDK_VER
+ std::cout << " EIGEN_CUDA_SDK_VER: " << int(EIGEN_CUDA_SDK_VER) << "\n";
#endif
+ #ifdef EIGEN_COMP_NVCC
+ std::cout << " EIGEN_COMP_NVCC: " << int(EIGEN_COMP_NVCC) << "\n";
+ #endif
+
#ifdef EIGEN_HIPCC
std::cout << " EIGEN_HIPCC: " << int(EIGEN_HIPCC) << "\n";
#endif
diff --git a/test/main.h b/test/main.h
index 1fe631ca9..93e894460 100644
--- a/test/main.h
+++ b/test/main.h
@@ -52,15 +52,17 @@
#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__
+#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
+ // Means the compiler is either nvcc or clang with CUDA enabled
+ #define EIGEN_CUDACC __CUDACC__
+#endif
+#if defined(EIGEN_CUDACC)
+#include <cuda.h>
+ #define EIGEN_CUDA_SDK_VER (CUDA_VERSION * 10)
#else
-#define EIGEN_TEST_CUDACC_VER 0
+ #define EIGEN_CUDA_SDK_VER 0
#endif
-
-#if EIGEN_TEST_CUDACC_VER >= 70500
+#if EIGEN_CUDA_SDK_VER >= 70500
#include <cuda_fp16.h>
#endif