GPU: propagate architecture name and LTO IR for ITS - #15687
Conversation
| target_include_directories(GPUTrackingCUDAExternalProvider PRIVATE $<TARGET_PROPERTY:${targetName},INCLUDE_DIRECTORIES>) | ||
| # Emit LTO IR next to the sm_XX cubin so consumers that device-link with -dlto | ||
| foreach(CUDA_ARCH ${CMAKE_CUDA_ARCHITECTURES}) | ||
| string(REGEX REPLACE "-.*$" "" CUDA_ARCH_STRIPPED "${CUDA_ARCH}") |
There was a problem hiding this comment.
You should strip duplicates in the CUDA_ARCH_STRIPPED list.
Beyond that it is fine with me. In principle, I am wondering is there a better way to provide the lto_option? In principle, there is CMAKE_CUDA_ARCHITECTURES, which generates the --generate-code strings. Is there no way that CMake instructrs CUDA to create lto code? If not, could you add a comment with #FIXME explaining this and telling to improve it once CMake support is there?
There was a problem hiding this comment.
Apparently CMake supports this properly by doing:
set_property(TARGET GPUTrackingCUDAExternalProvider PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
then it also emits LTO IR and we can use plain -dlto for the inlining or for ITS cuda:
set_property(TARGET ${targetName} PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
that way using -dlto ITS can inline for example the propagtor calls