forked from UoB-HPC/BabelStream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTD.cmake
33 lines (26 loc) · 1.2 KB
/
STD.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
register_flag_optional(CMAKE_CXX_COMPILER
"Any CXX compiler that is supported by CMake detection"
"c++")
register_flag_optional(NVHPC_OFFLOAD
"Enable offloading support (via the non-standard `-stdpar`) for the new NVHPC SDK.
The values are Nvidia architectures in ccXY format will be passed in via `-gpu=` (e.g `cc70`)
Possible values are:
cc35 - Compile for compute capability 3.5
cc50 - Compile for compute capability 5.0
cc60 - Compile for compute capability 6.0
cc62 - Compile for compute capability 6.2
cc70 - Compile for compute capability 7.0
cc72 - Compile for compute capability 7.2
cc75 - Compile for compute capability 7.5
cc80 - Compile for compute capability 8.0
ccall - Compile for all supported compute capabilities"
"")
macro(setup)
set(CMAKE_CXX_STANDARD 17)
if (NVHPC_OFFLOAD)
set(NVHPC_FLAGS -stdpar -gpu=${NVHPC_OFFLOAD})
# propagate flags to linker so that it links with the gpu stuff as well
register_append_cxx_flags(ANY ${NVHPC_FLAGS})
register_append_link_flags(${NVHPC_FLAGS})
endif ()
endmacro()