File tree Expand file tree Collapse file tree
GPU/GPUTracking/Base/cuda Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -204,4 +204,10 @@ add_library(O2::GPUTrackingCUDAExternalProvider ALIAS GPUTrackingCUDAExternalPro
204204set_property (TARGET GPUTrackingCUDAExternalProvider PROPERTY CUDA_SEPARABLE_COMPILATION ON )
205205target_compile_definitions (GPUTrackingCUDAExternalProvider PRIVATE $<TARGET_PROPERTY :${targetName} ,COMPILE_DEFINITIONS >)
206206target_include_directories (GPUTrackingCUDAExternalProvider PRIVATE $<TARGET_PROPERTY :${targetName} ,INCLUDE_DIRECTORIES >)
207+ # Emit LTO IR next to the sm_XX cubin so consumers that device-link with -dlto
208+ foreach (CUDA_ARCH ${CMAKE_CUDA_ARCHITECTURES} )
209+ string (REGEX REPLACE "-.*$" "" CUDA_ARCH_STRIPPED "${CUDA_ARCH} " )
210+ target_compile_options (GPUTrackingCUDAExternalProvider PRIVATE
211+ $<$<COMPILE_LANGUAGE :CUDA >:--generate -code =arch =compute_ ${CUDA_ARCH_STRIPPED} ,code =[lto_ ${CUDA_ARCH_STRIPPED} ]>)
212+ endforeach ()
207213add_dependencies (GPUTrackingCUDAExternalProvider O2::GPUTracking ) # must not depend on GPU backend to avoid cyclic dependencies
Original file line number Diff line number Diff line change @@ -78,4 +78,9 @@ function(o2_add_hipified_executable baseTargetName)
7878 o2_add_executable ("${baseTargetName} "
7979 SOURCES ${HIP_SOURCES}
8080 ${FORWARD_ARGS} )
81+
82+ # Export architecture name
83+ if (A_TARGETVARNAME)
84+ set (${A_TARGETVARNAME} ${${A_TARGETVARNAME} } PARENT_SCOPE )
85+ endif ()
8186endfunction ()
Original file line number Diff line number Diff line change @@ -72,4 +72,9 @@ function(o2_add_hipified_library baseTargetName)
7272 o2_add_library ("${baseTargetName} "
7373 SOURCES ${HIP_SOURCES}
7474 ${FORWARD_ARGS} )
75+
76+ # Export architecture name
77+ if (A_TARGETVARNAME)
78+ set (${A_TARGETVARNAME} ${${A_TARGETVARNAME} } PARENT_SCOPE )
79+ endif ()
7580endfunction ()
You can’t perform that action at this time.
0 commit comments