summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/CompileFlags
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-03-27 19:31:52 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-05-15 15:12:39 (GMT)
commita653ca9504569eb45077ee598945b18a3c9e4ee8 (patch)
tree9e2753a976a8b43a0cc06587dcc62bb0f3008c84 /Tests/CudaOnly/CompileFlags
parent5df21adf46be14061fe0e8ea53213d905e834600 (diff)
downloadCMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.zip
CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.gz
CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.bz2
Tests: Update CUDA tests to work with Clang
Diffstat (limited to 'Tests/CudaOnly/CompileFlags')
-rw-r--r--Tests/CudaOnly/CompileFlags/CMakeLists.txt9
-rw-r--r--Tests/CudaOnly/CompileFlags/main.cu7
2 files changed, 6 insertions, 10 deletions
diff --git a/Tests/CudaOnly/CompileFlags/CMakeLists.txt b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
index cbce7d6..5e8a8e4 100644
--- a/Tests/CudaOnly/CompileFlags/CMakeLists.txt
+++ b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
@@ -1,16 +1,15 @@
cmake_minimum_required(VERSION 3.17)
-cmake_policy(SET CMP0104 OLD)
project(CompileFlags CUDA)
-# Clear defaults.
-set(CMAKE_CUDA_ARCHITECTURES)
-
add_executable(CudaOnlyCompileFlags main.cu)
# Try passing CUDA architecture flags explicitly.
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
target_compile_options(CudaOnlyCompileFlags PRIVATE
-gencode arch=compute_50,code=compute_50
- --compiler-options=-DHOST_DEFINE
)
+else()
+ set_property(TARGET CudaOnlyCompileFlags PROPERTY CUDA_ARCHITECTURES 50-real)
endif()
+
+target_compile_options(CudaOnlyCompileFlags PRIVATE -DALWAYS_DEFINE)
diff --git a/Tests/CudaOnly/CompileFlags/main.cu b/Tests/CudaOnly/CompileFlags/main.cu
index 573d230..999c056 100644
--- a/Tests/CudaOnly/CompileFlags/main.cu
+++ b/Tests/CudaOnly/CompileFlags/main.cu
@@ -4,11 +4,8 @@
# endif
#endif
-// Check HOST_DEFINE only for nvcc
-#ifndef __CUDA__
-# ifndef HOST_DEFINE
-# error "HOST_DEFINE not defined!"
-# endif
+#ifndef ALWAYS_DEFINE
+# error "ALWAYS_DEFINE not defined!"
#endif
int main()