Skip to content

Commit d71b3b6

Browse files
authored
Merge pull request #9679 from fwyzard/IB/CMSSW_15_1_X/master_CUDA_flags
Enable new CUDA visibility flags
2 parents 4c2ae01 + 7218091 commit d71b3b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cuda-flags.file

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
# allow __host__, __device__ attributes in lambda declaration
2727
%define nvcc_flags_lambda --extended-lambda
2828

29+
# - in whole-program compilation mode (-rdc=false), force 'static' linkage for host side stub functions generated for __global__ function templates
30+
# - mark __global__ functions and function templates, and __constant__, __device__ and __managed__ variables and variable templates, with __attribute__((visibility("hidden")))
31+
%define nvcc_visibility_flags --static-global-template-stub=true --device-entity-has-hidden-visibility=true
32+
2933
# build support for the various compute architectures
3034
%define nvcc_flags_cuda_archs %(echo $(for ARCH in %cuda_arch; do echo "-gencode arch=compute_$ARCH,code=[sm_$ARCH,compute_$ARCH]"; done)) -Wno-deprecated-gpu-targets
3135

@@ -46,5 +50,5 @@
4650

4751
# collect all CUDA flags
4852
%define nvcc_cuda_flags \
49-
%{nvcc_flags_stdcxx} %{nvcc_flags_opt} %{nvcc_flags_debug} %{nvcc_flags_constexpr} %{nvcc_flags_lambda} \
53+
%{nvcc_flags_stdcxx} %{nvcc_flags_opt} %{nvcc_flags_debug} %{nvcc_flags_constexpr} %{nvcc_flags_lambda} %{nvcc_visibility_flags} \
5054
%{nvcc_flags_cuda_archs} %{nvcc_flags_cuda_diag_suppress} %{nvcc_flags_cudafe_diag} %{nvcc_flags_gnu_version} %{nvcc_flags_cudart}

0 commit comments

Comments
 (0)