-
Notifications
You must be signed in to change notification settings - Fork 5
/
settings.cmake
47 lines (46 loc) · 2.2 KB
/
settings.cmake
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# set compute capability from environment variable (directly useable as nvcc flag)
if("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.1")
message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.2")
message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.3")
message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "2.0")
message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "2.1")
message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.0")
set(CUDA_NVCC_FLAGS -arch=sm_30)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.2")
set(CUDA_NVCC_FLAGS -arch=sm_32)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.5")
set(CUDA_NVCC_FLAGS -arch=sm_35)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.7")
set(CUDA_NVCC_FLAGS -arch=sm_37)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.0")
set(CUDA_NVCC_FLAGS -arch=sm_50)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.2")
set(CUDA_NVCC_FLAGS -arch=sm_52)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.3")
set(CUDA_NVCC_FLAGS -arch=sm_53)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.0")
set(CUDA_NVCC_FLAGS -arch=sm_60)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.1")
set(CUDA_NVCC_FLAGS -arch=sm_61)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.2")
set(CUDA_NVCC_FLAGS -arch=sm_62)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.0")
set(CUDA_NVCC_FLAGS -arch=sm_70)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.2")
set(CUDA_NVCC_FLAGS -arch=sm_72)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.5")
set(CUDA_NVCC_FLAGS -arch=sm_75)
else()
set(CUDA_NVCC_FLAGS -arch=sm_30)
endif()
#------------- for further compiler flags see compiler_settings.cmake.txt -----------------
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/compiler_settings.cmake)
#----------------------------------------------------------------------------------------