blob: cbce7d6a68b532988ba4f258feb8e4b70f488900 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()
|