Skip to content

[SYCL] Enable referencing a kernel from a different translation unit#22264

Open
sergey-semenov wants to merge 5 commits into
intel:syclfrom
sergey-semenov:crosstugetkernelid
Open

[SYCL] Enable referencing a kernel from a different translation unit#22264
sergey-semenov wants to merge 5 commits into
intel:syclfrom
sergey-semenov:crosstugetkernelid

Conversation

@sergey-semenov

Copy link
Copy Markdown
Contributor

Prior to this patch, referencing a kernel from another translation unit
via kernel bundle/ID API led to undefined behavior due to usage of KernelInfo
specializations from integration headers (which are only provided for the TUs
the kernels are provided in). This patch fixes that by using inline friend
function definitions that provide symbols with external linkage that the runtime
can call to retrieve kernel names from any translation unit. If the user attempts
to request a kernel via a kernel name type that doesn't exist,
it will now result in an undefined reference error instead of a runtime one.

Prior to this patch, referencing a kernel from another translation unit
via kernel bundle/ID API led to undefined behavior due to usage of KernelInfo
specializations from integration headers (which are only provided for the TUs
the kernels are provided in). This patch fixes that by using inline friend
function definitions that provide symbols with external linkage that the runtime
can call to retrieve kernel names from any translation unit. If the user attempts
to request a kernel via a kernel name type that doesn't exist,
it will now result in an undefined reference error instead of a runtime one.
@sergey-semenov sergey-semenov requested a review from slawekptak June 9, 2026 13:44
@sergey-semenov sergey-semenov requested a review from a team as a code owner June 9, 2026 13:44
@sergey-semenov

Copy link
Copy Markdown
Contributor Author

Reopen of #22246.
@tahonermann Thanks for the review on the original PR, will ping you once your comments are addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant