summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake
index d16156e..6fecae7 100644
--- a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake
@@ -4,3 +4,18 @@ run_cmake(architectures-all)
run_cmake(architectures-all-major)
run_cmake(architectures-empty)
run_cmake(architectures-invalid)
+
+run_cmake(architectures-not-set)
+include("${RunCMake_BINARY_DIR}/architectures-not-set-build/info.cmake" OPTIONAL)
+message(STATUS " CMAKE_CUDA_COMPILER_ID='${CMAKE_CUDA_COMPILER_ID}'")
+message(STATUS " CMAKE_CUDA_COMPILER_VERSION='${CMAKE_CUDA_COMPILER_VERSION}'")
+message(STATUS " CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'")
+
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" AND CMAKE_CUDA_ARCHITECTURES)
+ list(GET CMAKE_CUDA_ARCHITECTURES 0 arch)
+ set(CMAKE_CUDA_FLAGS --cuda-gpu-arch=sm_${arch})
+ message(STATUS "Adding CMAKE_CUDA_FLAGS='${CMAKE_CUDA_FLAGS}' for CMAKE_CUDA_ARCHITECTURES=OFF with Clang.")
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_CUDA_FLAGS=${CMAKE_CUDA_FLAGS}")
+endif()
+run_cmake(architectures-off)
+unset(RunCMake_TEST_OPTIONS)