Skip to content

[SYCL] Allow work group scratch memory to be used with free function kernels #19837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: sycl
Choose a base branch
from

Conversation

lbushi25
Copy link
Contributor

@lbushi25 lbushi25 commented Aug 20, 2025

When a kernel uses implicit local memory such as by way of the get_work_group_scratch_memory function, the library is supposed to mark the kernel with the appropriate attribute WORK_GROUP_STATIC_ATTR to get things to work at runtime. This is done through the properties passed to the kernel invocation call. For free function kernels however, the infrastructure is not there to do this marking process and usage of the above mentioned function typically results in a UR error.

This PR makes some changes at the middle-end level to traverse the call graph wherever the compiler built-in function __sycl_allocateLocalMemory is used and mark each of the kernels found during this traversal , including free function kernels, with the WORK_GROUP_STATIC_ATTR attribute if not already present.

@lbushi25 lbushi25 marked this pull request as ready for review August 21, 2025 06:07
@lbushi25 lbushi25 requested review from a team as code owners August 21, 2025 06:07
@lbushi25 lbushi25 requested a review from slawekptak August 21, 2025 06:07
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