diff options
author | Raul Tambre <raul@tambre.ee> | 2020-03-27 19:31:52 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-05-15 15:12:39 (GMT) |
commit | a653ca9504569eb45077ee598945b18a3c9e4ee8 (patch) | |
tree | 9e2753a976a8b43a0cc06587dcc62bb0f3008c84 /Tests/Cuda | |
parent | 5df21adf46be14061fe0e8ea53213d905e834600 (diff) | |
download | CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.zip CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.gz CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.bz2 |
Tests: Update CUDA tests to work with Clang
Diffstat (limited to 'Tests/Cuda')
-rw-r--r-- | Tests/Cuda/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Tests/Cuda/ProperLinkFlags/CMakeLists.txt | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt index 58b9b03..83f2f2d 100644 --- a/Tests/Cuda/CMakeLists.txt +++ b/Tests/Cuda/CMakeLists.txt @@ -1,5 +1,4 @@ -ADD_TEST_MACRO(Cuda.Complex CudaComplex) ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures) ADD_TEST_MACRO(Cuda.CXXStandardSetTwice CXXStandardSetTwice) ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary) @@ -12,10 +11,16 @@ ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled) ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly) ADD_TEST_MACRO(Cuda.Toolkit Toolkit) ADD_TEST_MACRO(Cuda.IncludePathNoToolkit IncludePathNoToolkit) -ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries) -ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags) ADD_TEST_MACRO(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit) +# Separable compilation is currently only supported on NVCC. Disable tests +# using it for other compilers. +if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + ADD_TEST_MACRO(Cuda.Complex CudaComplex) + ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries) + ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags) +endif() + # The CUDA only ships the shared version of the toolkit libraries # on windows if(NOT WIN32) diff --git a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt index b6e0e39..d38da6d 100644 --- a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt +++ b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt @@ -9,11 +9,17 @@ 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 -string(APPEND CMAKE_CUDA_FLAGS " -arch=sm_35 --use_fast_math") +if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + string(APPEND CMAKE_CUDA_FLAGS "--use_fast_math") +elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") + string(APPEND CMAKE_CUDA_FLAGS "-ffast-math") +endif() + set(CMAKE_CXX_FLAGS "-Wall") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) +set(CMAKE_CUDA_ARCHITECTURES 35) add_executable(ProperLinkFlags file1.cu main.cxx) set_target_properties( ProperLinkFlags |