Skip to content

GPU: propagate architecture name and LTO IR for ITS - #15687

Open
f3sch wants to merge 1 commit into
AliceO2Group:devfrom
f3sch:gpu/lto
Open

GPU: propagate architecture name and LTO IR for ITS#15687
f3sch wants to merge 1 commit into
AliceO2Group:devfrom
f3sch:gpu/lto

Conversation

@f3sch

@f3sch f3sch commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

that way using -dlto ITS can inline for example the propagtor calls

@f3sch
f3sch requested review from a team and davidrohr as code owners August 17, 2026 19:57
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}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants