summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/ExportPTX
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-11-27 15:18:29 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-11-30 15:57:27 (GMT)
commitc57541d874ce2a22555e1aae302d27190d74a5a4 (patch)
treec764012711bf3b70856ae78b643e86016a95fee4 /Tests/CudaOnly/ExportPTX
parentc4ae9384ff4d355f51c06180984dd4d053f074cc (diff)
downloadCMake-c57541d874ce2a22555e1aae302d27190d74a5a4.zip
CMake-c57541d874ce2a22555e1aae302d27190d74a5a4.tar.gz
CMake-c57541d874ce2a22555e1aae302d27190d74a5a4.tar.bz2
CUDA: Fix tests with CUDAARCHS set
With CUDAARCHS there's the possibility of tests being run with multiple architectures or having CMAKE_CUDA_ARCHITECTURES set with NVCC despite CMP0104 being OLD. Fix a few tests to work properly in such cases.
Diffstat (limited to 'Tests/CudaOnly/ExportPTX')
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
index ee5f54d..e7e7bc4 100644
--- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt
+++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.19)
project (ExportPTX CUDA)
#Goal for this example:
@@ -6,6 +6,10 @@ project (ExportPTX CUDA)
# How to reference PTX files for custom commands
# How to install PTX files
+# PTX can be compiled only for a single virtual architecture at a time
+list(SUBLIST CMAKE_CUDA_ARCHITECTURES 0 1 CMAKE_CUDA_ARCHITECTURES)
+string(APPEND CMAKE_CUDA_ARCHITECTURES "-virtual")
+
add_library(CudaPTX OBJECT kernelA.cu kernelB.cu)
set_property(TARGET CudaPTX PROPERTY CUDA_PTX_COMPILATION ON)