mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-03 21:27:48 +00:00
CUDA: Fix test cases to not override CUDA flags
Append to `CMAKE_CUDA_FLAGS` instead of overwriting it.
This commit is contained in:
@@ -15,7 +15,7 @@ project (CudaComplex CXX CUDA)
|
||||
#and also bulding cpp targets that need cuda implicit libraries
|
||||
|
||||
#verify that we can pass explicit cuda arch flags
|
||||
set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
|
||||
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
|
||||
set(CMAKE_CUDA_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
|
||||
|
||||
@@ -9,7 +9,7 @@ project (ProperLinkFlags CUDA CXX)
|
||||
|
||||
#Specify a set of valid CUDA flags and an invalid set of CXX flags ( for CUDA )
|
||||
#to make sure we don't use the CXX flags when linking CUDA executables
|
||||
set(CMAKE_CUDA_FLAGS "-arch=sm_35 --use_fast_math")
|
||||
string(APPEND CMAKE_CUDA_FLAGS " -arch=sm_35 --use_fast_math")
|
||||
set(CMAKE_CXX_FLAGS "-Wall")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(CudaComplex CUDA C)
|
||||
|
||||
set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
|
||||
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
|
||||
|
||||
add_executable(CudaWithC main.c cuda.cu)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ project (CudaOnlySeparateCompilation CUDA)
|
||||
#and executables.
|
||||
#We complicate the matter by also testing that multiple static libraries
|
||||
#all containing cuda separable compilation code links properly
|
||||
set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
|
||||
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CUDA_STANDARD 11)
|
||||
add_library(CUDASerarateLibA STATIC file1.cu file2.cu file3.cu)
|
||||
|
||||
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.7)
|
||||
project (CudaOnlyWithDefs CUDA)
|
||||
|
||||
#verify that we can pass explicit cuda arch flags
|
||||
set(CMAKE_CUDA_FLAGS "-gencode arch=compute_30,code=compute_30")
|
||||
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
|
||||
set(debug_compile_flags --generate-code arch=compute_20,code=sm_20)
|
||||
if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
|
||||
list(APPEND debug_compile_flags -Xcompiler=-WX)
|
||||
|
||||
Reference in New Issue
Block a user