summaryrefslogtreecommitdiffstats
path: root/Tests/Cuda
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-03-27 18:52:39 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-04-15 14:55:41 (GMT)
commitf0931b07905a960c7dfbcc90e772219150c24951 (patch)
treedefe47dc5d287e9db57bf33905b927547ec770bd /Tests/Cuda
parente98588aabad578a9b33aae05e77f6ec5b3ff2e46 (diff)
downloadCMake-f0931b07905a960c7dfbcc90e772219150c24951.zip
CMake-f0931b07905a960c7dfbcc90e772219150c24951.tar.gz
CMake-f0931b07905a960c7dfbcc90e772219150c24951.tar.bz2
CUDA: Convert tests to use CUDA_ARCHITECTURES
Diffstat (limited to 'Tests/Cuda')
-rw-r--r--Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt3
-rw-r--r--Tests/Cuda/Complex/CMakeLists.txt2
-rw-r--r--Tests/Cuda/MixedStandardLevels1/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels2/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels3/CMakeLists.txt2
-rw-r--r--Tests/Cuda/MixedStandardLevels4/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels5/CMakeLists.txt3
-rw-r--r--Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt2
-rw-r--r--Tests/Cuda/WithC/CMakeLists.txt2
9 files changed, 9 insertions, 14 deletions
diff --git a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
index 1941c49..f4ad83a 100644
--- a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
+++ b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(CXXStandardSetTwice CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(CXXStandardSetTwice main.cu)
target_compile_features(CXXStandardSetTwice PUBLIC cxx_std_11)
diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 08d1e16..265bd85 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -15,7 +15,7 @@ project (Complex CXX CUDA)
#and also building cpp targets that need cuda implicit libraries
#verify that we can pass explicit cuda arch flags
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
index b03e51e..e40ffa6 100644
--- a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
@@ -1,10 +1,9 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels1 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels1 main.cu lib.cpp)
diff --git a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
index 12dd328..7af8081 100644
--- a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels2 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 17) #this can decay
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels2 main.cu lib.cpp)
target_compile_features(MixedStandardLevels2 PUBLIC cuda_std_11)
diff --git a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
index 2b611be..2c42003 100644
--- a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels3 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels3 main.cu lib.cpp)
target_compile_features(MixedStandardLevels3 PUBLIC cuda_std_03 cxx_std_14)
diff --git a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
index faf6869..230230d 100644
--- a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels4 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CUDA_STANDARD 03)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels4 main.cu lib.cpp)
target_compile_features(MixedStandardLevels4 PUBLIC cxx_std_14)
diff --git a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
index 7209f60..5f5ee06 100644
--- a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels5 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 98)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels5 main.cu lib.cpp)
diff --git a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
index cb47b09..fe28c3e 100644
--- a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
+++ b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.13)
project(ProperDeviceLibraries CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_35,code=compute_35 -gencode arch=compute_35,code=sm_35")
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 35)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt
index 69aa3f9..049cbce 100644
--- a/Tests/Cuda/WithC/CMakeLists.txt
+++ b/Tests/Cuda/WithC/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)
project(WithC CUDA C)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(CudaWithC main.c cuda.cu)