-
Notifications
You must be signed in to change notification settings - Fork 184
/
Copy pathcuda-flags.file
43 lines (30 loc) · 1.56 KB
/
cuda-flags.file
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
### FILE cuda-flags
# define the CUDA compilation flags in a way that can be shared by SCRAM-based and regular tools
# on X86 and Power, build support for Pascal, Volta and Turing
%ifarch x86_64 ppc64le
%define cuda_arch 60 70 75
%endif
# on ARM, build support for Volta, Xavier SoC and Turing
%ifarch aarch64
%define cuda_arch 70 72 75
%endif
# LLVM style for listing the supported CUDA compute architectures
%define llvm_cuda_arch %(echo $(for ARCH in %cuda_arch; do echo "$ARCH"; done) | sed -e"s/ /,/g")
# C++ standard to use for building host and device code with nvcc
%define nvcc_stdcxx -std=c++17
# generate optimised code
%define cuda_flags_0 -O3
# generate debugging information for device code
%define cuda_flags_1 --generate-line-info --source-in-ptx --display-error-number
# imply __host__, __device__ attributes in constexpr functions
%define cuda_flags_2 --expt-relaxed-constexpr
# allow __host__, __device__ attributes in lambda declaration
%define cuda_flags_3 --extended-lambda
# build support for the various compute architectures
%define cuda_flags_4 %(echo $(for ARCH in %cuda_arch; do echo "-gencode arch=compute_$ARCH,code=sm_$ARCH"; done)) -Wno-deprecated-gpu-targets
# disable warnings about attributes on defaulted methods
%define cuda_flags_5 -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored
# link the CUDA runtime shared library
%define cuda_flags_6 --cudart shared
# collect all CUDA flags
%define nvcc_cuda_flags %{nvcc_stdcxx} %{cuda_flags_0} %{cuda_flags_1} %{cuda_flags_2} %{cuda_flags_3} %{cuda_flags_4} %{cuda_flags_5} %{cuda_flags_6}