Skip to content

Conversation

AlexeySachkov
Copy link
Contributor

This is a cherry-pick of #19837

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 functions
__sycl_allocateLocalMemory and __sycl_dynamicLocalMemoryPlaceholder are 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.

…kernels (intel#19837)

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 functions
`__sycl_allocateLocalMemory` and `__sycl_dynamicLocalMemoryPlaceholder`
are 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.
@AlexeySachkov
Copy link
Contributor Author

Unexpectedly Passed Tests (1):
  SYCL :: KernelAndProgram/kernel-bundle-get-kernel-ids.cpp

That is a known XPASS, I will proceed with merge

@AlexeySachkov AlexeySachkov merged commit f7db283 into intel:sycl-rel-6_3 Sep 8, 2025
21 of 23 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/cherry-pick-19837 branch September 8, 2025 10:18
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.

2 participants