[UR] statically link ur loader with sycl by default#22031
Open
pbalcer wants to merge 6 commits into
Open
Conversation
47a50a8 to
9c08b4c
Compare
4e0e2cd to
8260659
Compare
SYCL already does XPTI initialization and teardown, doing it twice when statically linking leads to double free.
Instead of __attribute__((weak)) on the SymbolizeCode function, which fails to resolve at runtime when using static linking.
kswiecicki
approved these changes
May 18, 2026
Contributor
kswiecicki
left a comment
There was a problem hiding this comment.
LGTM, but we could document the new option in README.md.
slawekptak
reviewed
May 18, 2026
| set(_sycl_ur_loader UnifiedRuntimeLoaderDebug) | ||
| elseif(NOT WIN32 OR UR_STATIC_LOADER) | ||
| set(_sycl_ur_loader UnifiedRuntimeLoader) | ||
| else() |
Contributor
There was a problem hiding this comment.
Can you please add a comment which conditions fall into else?
8260659 to
45ef3f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch enables UR static linking with libsycl, and also makes a change to the adapter discovery logic so that it searches for adapter libraries first in the canonical path of the loader/sycl executable. This enables UR loader, in applications that use RPATH, to properly find the adapter files, even when multiple different versions of UR are present in ld search directories.