diff options
author | Brad King <brad.king@kitware.com> | 2022-03-02 20:28:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-02 20:51:45 (GMT) |
commit | dae3ad08fa1fe3078bf2fd3e949a078ca24e5636 (patch) | |
tree | b2e6237759642dbf80ddcec232f7f00db2d9eb16 /Tests | |
parent | 5c1f5357b0335158aa7b31990d1df26fd04114f2 (diff) | |
download | CMake-dae3ad08fa1fe3078bf2fd3e949a078ca24e5636.zip CMake-dae3ad08fa1fe3078bf2fd3e949a078ca24e5636.tar.gz CMake-dae3ad08fa1fe3078bf2fd3e949a078ca24e5636.tar.bz2 |
Tests: Add cases for CMAKE_CUDA_ARCHITECTURES={all,all-major}
The `CudaOnly.All` test only sets these in project code after CUDA is
enabled. Add another case to test the values during compiler detection.
Issue: #23161
Diffstat (limited to 'Tests')
5 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake index cbbf57c..d16156e 100644 --- a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake @@ -1,4 +1,6 @@ include(RunCMake) +run_cmake(architectures-all) +run_cmake(architectures-all-major) run_cmake(architectures-empty) run_cmake(architectures-invalid) diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt new file mode 100644 index 0000000..c5cde8f --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt @@ -0,0 +1,3 @@ +-- CMAKE_CUDA_ARCHITECTURES='all-major' +-- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+' +-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+' diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all-major.cmake b/Tests/RunCMake/CUDA_architectures/architectures-all-major.cmake new file mode 100644 index 0000000..5112473 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-all-major.cmake @@ -0,0 +1,5 @@ +set(CMAKE_CUDA_ARCHITECTURES "all-major") +enable_language(CUDA) +message(STATUS "CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'") +message(STATUS "CMAKE_CUDA_ARCHITECTURES_ALL='${CMAKE_CUDA_ARCHITECTURES_ALL}'") +message(STATUS "CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='${CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR}'") diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt new file mode 100644 index 0000000..aba26b9 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt @@ -0,0 +1,3 @@ +-- CMAKE_CUDA_ARCHITECTURES='all' +-- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+' +-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+' diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all.cmake b/Tests/RunCMake/CUDA_architectures/architectures-all.cmake new file mode 100644 index 0000000..32175f6 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-all.cmake @@ -0,0 +1,5 @@ +set(CMAKE_CUDA_ARCHITECTURES "all") +enable_language(CUDA) +message(STATUS "CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'") +message(STATUS "CMAKE_CUDA_ARCHITECTURES_ALL='${CMAKE_CUDA_ARCHITECTURES_ALL}'") +message(STATUS "CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='${CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR}'") |