generated from jamesnulliu/VSC-Python-Project-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcuda-compiler-configs.cmake
More file actions
27 lines (22 loc) · 1.02 KB
/
cuda-compiler-configs.cmake
File metadata and controls
27 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# ==================================================================================================
# @file compiler-configs-cuda.cmake
# @brief Compiler configurations for cuda.
#
# @note Values SHOULD be set BEFORE including this file:
# - `ENV{NVCC_CCBIN}`: CUDA Compiler bindir. Default: auto-detected.
# - `CMAKE_CUDA_STANDARD`: CUDA Standard. Default: 20.
# ==================================================================================================
include(${CMAKE_CURRENT_LIST_DIR}/../utils/logging.cmake)
enable_language(CUDA)
if(WIN32)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
log_fatal("You have to use MSVC for CUDA on Windows")
endif()
endif()
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_ARCHITECTURES native)
log_info("CMAKE_CUDA_STANDARD: ${CMAKE_CUDA_STANDARD}")
string(APPEND CMAKE_CUDA_FLAGS " --expt-relaxed-constexpr")
string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO " -lineinfo")
string(APPEND CMAKE_CUDA_FLAGS_DEBUG " -lineinfo")