summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-01 13:49:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-01 13:49:15 (GMT)
commit54a4aa57791b0d70045182cee4f1f5cb55a2a61c (patch)
tree7d4eadef304bfb6dbccf8dd5868a011171d781d6 /Tests
parentaa3675d28186124a3175b89ed9bfd426c5d6b530 (diff)
parent45584508fa26a20981e2b3db08a11cc797f78727 (diff)
downloadCMake-54a4aa57791b0d70045182cee4f1f5cb55a2a61c.zip
CMake-54a4aa57791b0d70045182cee4f1f5cb55a2a61c.tar.gz
CMake-54a4aa57791b0d70045182cee4f1f5cb55a2a61c.tar.bz2
Merge topic 'cuda-ipo-arch'
45584508fa CUDA/NVIDIA: fix LTO with explicit architectures Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !8508
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CudaOnly/DeviceLTO/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/CudaOnly/DeviceLTO/CMakeLists.txt b/Tests/CudaOnly/DeviceLTO/CMakeLists.txt
index 653b35d..5653bdf 100644
--- a/Tests/CudaOnly/DeviceLTO/CMakeLists.txt
+++ b/Tests/CudaOnly/DeviceLTO/CMakeLists.txt
@@ -9,16 +9,23 @@ project(DeviceLTO CUDA)
add_library(CUDA_dlto STATIC file1.cu file2.cu file3.cu)
add_executable(CudaOnlyDeviceLTO main.cu)
+set(archs_to_test "${CMAKE_CUDA_ARCHITECTURES_ALL}")
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ # Also test with at least one virtual architecture.
+ list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR latest_arch)
+ list(APPEND archs_to_test ${latest_arch}-virtual)
+endif()
+
set_target_properties(CUDA_dlto
PROPERTIES
- CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_ALL}"
+ CUDA_ARCHITECTURES "${archs_to_test}"
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON)
set_target_properties(CudaOnlyDeviceLTO
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
- CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_ALL}"
+ CUDA_ARCHITECTURES "${archs_to_test}"
)
target_link_libraries(CudaOnlyDeviceLTO PRIVATE CUDA_dlto)