diff options
author | Brad King <brad.king@kitware.com> | 2022-04-28 18:46:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-29 13:07:53 (GMT) |
commit | 7bf520069938dcb106f9c0c7cc71ac079055ceed (patch) | |
tree | 87bfe43b50cdd8542178036298dd545f53f3707e /Tests/RunCMake/CUDA_architectures | |
parent | d35f1c9beee14f1be1e39838b5d4be0906a48974 (diff) | |
download | CMake-7bf520069938dcb106f9c0c7cc71ac079055ceed.zip CMake-7bf520069938dcb106f9c0c7cc71ac079055ceed.tar.gz CMake-7bf520069938dcb106f9c0c7cc71ac079055ceed.tar.bz2 |
CUDA: Restore CMAKE_CUDA_ARCHITECTURES support for -real and -virtual suffixes
Fix the validation regex added by commit c267ed205a (CUDA: Defer
architecture testing to the compiler testing step, 2022-04-25) to
allow these values.
Diffstat (limited to 'Tests/RunCMake/CUDA_architectures')
5 files changed, 22 insertions, 3 deletions
diff --git a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake index e37d025..3e6b3a5 100644 --- a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake @@ -20,3 +20,8 @@ if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" AND CMAKE_CUDA_ARCHITECTURES) endif() run_cmake(architectures-off) unset(RunCMake_TEST_OPTIONS) + +if(CMAKE_CUDA_ARCHITECTURES MATCHES "([0-9]+)") + set(arch "${CMAKE_MATCH_1}") + run_cmake_with_options(architectures-suffix -Darch=${arch}) +endif() diff --git a/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt b/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt index 48f379c..14c76d2 100644 --- a/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt +++ b/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt @@ -5,9 +5,9 @@ is not one of the following: - \* a semicolon-separated list of integers - - \* a special value: all, all-major, native + \* a semicolon-separated list of integers, each optionally + followed by '-real' or '-virtual' + \* a special value: all, all-major, native Call Stack \(most recent call first\): architectures-invalid\.cmake:2 \(enable_language\) diff --git a/Tests/RunCMake/CUDA_architectures/architectures-suffix-stderr.txt b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stderr.txt new file mode 100644 index 0000000..7b6eb53 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stderr.txt @@ -0,0 +1,4 @@ +^(CMake Warning in [^ +]*/Tests/RunCMake/CUDA_architectures/architectures-suffix-build/CMakeFiles/CMakeTmp/CMakeLists.txt: + Clang doesn't support disabling CUDA real code generation. +*)*$ diff --git a/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt new file mode 100644 index 0000000..22ed7f6 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt @@ -0,0 +1,4 @@ +-- CMAKE_CUDA_ARCHITECTURES='[0-9]+-real;[0-9]+-virtual;' +-- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+' +-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+' +-- CMAKE_CUDA_ARCHITECTURES_NATIVE='[0-9;]+' diff --git a/Tests/RunCMake/CUDA_architectures/architectures-suffix.cmake b/Tests/RunCMake/CUDA_architectures/architectures-suffix.cmake new file mode 100644 index 0000000..8d7ec03 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-suffix.cmake @@ -0,0 +1,6 @@ +set(CMAKE_CUDA_ARCHITECTURES "${arch}-real;${arch}-virtual;") +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}'") +message(STATUS "CMAKE_CUDA_ARCHITECTURES_NATIVE='${CMAKE_CUDA_ARCHITECTURES_NATIVE}'") |