aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar tra <tra@google.com>2019-05-31 14:08:34 -0700
committerGravatar tra <tra@google.com>2019-05-31 14:08:34 -0700
commitb4c49bf00ec133c6f76de2bce446a770525c0ea2 (patch)
treeaae47d14f340ecb71aa3355aac746ad0e6911733 /test/CMakeLists.txt
parent56144005811e3e5a76031ba0aac8a4e1fa3e3396 (diff)
Minor build improvements
* Allow specifying multiple GPU architectures. E.g.: cmake -DEIGEN_CUDA_COMPUTE_ARCH="60;70" * Pass CUDA SDK path to clang. Without it it will default to /usr/local/cuda which may not be the right location, if cmake was invoked with -DCUDA_TOOLKIT_ROOT_DIR=/some/other/CUDA/path
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8c58f2a33..c9e1b7b36 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -393,7 +393,11 @@ if(CUDA_FOUND)
set(CUDA_NVCC_FLAGS "-ccbin ${CMAKE_C_COMPILER}" CACHE STRING "nvcc flags" FORCE)
endif()
if(EIGEN_TEST_CUDA_CLANG)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 --cuda-gpu-arch=sm_30")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ string(APPEND CMAKE_CXX_FLAGS " --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
+ foreach(GPU IN LISTS EIGEN_CUDA_COMPUTE_ARCH)
+ string(APPEND CMAKE_CXX_FLAGS " --cuda-gpu-arch=sm_${GPU}")
+ endforeach()
endif()
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")