diff options
Diffstat (limited to 'Tests/CudaOnly/CompileFlags/CMakeLists.txt')
-rw-r--r-- | Tests/CudaOnly/CompileFlags/CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/CudaOnly/CompileFlags/CMakeLists.txt b/Tests/CudaOnly/CompileFlags/CMakeLists.txt new file mode 100644 index 0000000..cbce7d6 --- /dev/null +++ b/Tests/CudaOnly/CompileFlags/CMakeLists.txt @@ -0,0 +1,16 @@ +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 + ) +endif() |