-
Notifications
You must be signed in to change notification settings - Fork 822
[SYCL] Throw runtime exception when kernel uses work group scratch memory but has not been launched with the work_group_scratch_size property #21850
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
Merged
uditagarwal97
merged 18 commits into
intel:sycl
from
lbushi25:diagnose_work_group_scratch_memory_error
Apr 30, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a69a409
Implement runtime exception when kernel uses work group scratch memor…
lbushi25 cd8fc90
Add E2E test
lbushi25 5421ad8
Fix bug in indirect call to get_work_group_scratch_memory
lbushi25 209fce1
Merge branch 'intel:sycl' into diagnose_work_group_scratch_memory_error
lbushi25 110271f
Fix formatting
lbushi25 5f6a047
Merge branch 'diagnose_work_group_scratch_memory_error' of https://gi…
lbushi25 dbb5e36
More formatting
lbushi25 5727846
remove delete abi symbol
lbushi25 98672a3
Update documentation
lbushi25 60ba29f
Update documentation
lbushi25 ae8dd74
Address feedback
lbushi25 341fb16
Fix compilation failures
lbushi25 175b8a8
Update ComputeModuleRuntimeInfo.cpp
lbushi25 3ba49b6
Undo a ABI-breaking change
lbushi25 a00b41f
Apply more feedback
lbushi25 1976cdd
Update PropertySets.md
lbushi25 bc81feb
Address last batch of feedback
lbushi25 25b78f3
Merge branch 'diagnose_work_group_scratch_memory_error' of https://gi…
lbushi25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ target triple = "spir64-unknown-unknown" | |
| ; CHECK: @__sycl_dynamicLocalMemoryPlaceholder_GV = linkonce_odr local_unnamed_addr addrspace(3) global ptr addrspace(3) poison | ||
|
|
||
| ; Function Attrs: convergent norecurse | ||
| ; CHECK: @_ZTS7KernelA(ptr addrspace(1) %0, ptr addrspace(3) noalias "sycl-implicit-local-arg" %[[IMPLICT_ARG:[a-zA-Z0-9]+]]{{.*}} !kernel_arg_addr_space ![[ADDR_SPACE_MD:[0-9]+]] | ||
| ; CHECK: @_ZTS7KernelA(ptr addrspace(1) %0, ptr addrspace(3) noalias "sycl-implicit-local-arg" %[[IMPLICT_ARG:[a-zA-Z0-9]+]]{{.*}} #[[FULL_DYNAMIC_MEM_ATTRS:[0-9]+]] !kernel_arg_addr_space ![[ADDR_SPACE_MD:[0-9]+]] | ||
| define weak_odr dso_local spir_kernel void @_ZTS7KernelA(ptr addrspace(1) %0) local_unnamed_addr #0 !kernel_arg_addr_space !5 { | ||
| entry: | ||
| ; CHECK: store ptr addrspace(3) %[[IMPLICT_ARG]], ptr addrspace(3) @__sycl_dynamicLocalMemoryPlaceholder_GV | ||
|
|
@@ -22,28 +22,47 @@ entry: | |
| } | ||
|
|
||
| ; Function Attrs: convergent norecurse | ||
| ; CHECK: @__sycl_kernel_B{{.*}} #[[ATTRS:[0-9]+]] | ||
| ; CHECK: @__sycl_kernel_B{{.*}} #[[DYNAMIC_MEM_ATTRS:[0-9]+]] | ||
| define weak_odr dso_local spir_kernel void @__sycl_kernel_B(ptr addrspace(1) %0) local_unnamed_addr #1 !kernel_arg_addr_space !5 { | ||
| entry: | ||
| %1 = tail call spir_func ptr addrspace(3) @__sycl_dynamicLocalMemoryPlaceholder(i64 128) #1 | ||
| ret void | ||
| } | ||
|
|
||
| ; Function Attrs: convergent norecurse | ||
| ; CHECK: @__sycl_kernel_C{{.*}} #[[ATTRS]] | ||
| ; CHECK: @__sycl_kernel_C{{.*}} #[[DYNAMIC_MEM_ATTRS]] | ||
|
lbushi25 marked this conversation as resolved.
|
||
| define weak_odr dso_local spir_kernel void @__sycl_kernel_C(ptr addrspace(1) %0) local_unnamed_addr #1 !kernel_arg_addr_space !5 { | ||
| entry: | ||
| %1 = tail call spir_func ptr addrspace(3) @__sycl_allocateLocalMemory(i64 128, i64 4) #1 | ||
| %2 = tail call spir_func ptr addrspace(3) @__sycl_allocateLocalMemoryIndirect() #1 | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-NOT: "sycl-work-group-scratch" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this check-not is always true and can be removed. |
||
| ; Function Attrs: convergent norecurse | ||
| ; CHECK: @__sycl_kernel_D{{.*}} #[[STATIC_MEM_ATTRS:[0-9]+]] | ||
| define weak_odr dso_local spir_kernel void @__sycl_kernel_D(ptr addrspace(1) %0) local_unnamed_addr #1 !kernel_arg_addr_space !5 { | ||
| entry: | ||
| %1 = tail call spir_func ptr addrspace(3) @__sycl_allocateLocalMemory(i64 128, i64 4) #1 | ||
| ret void | ||
| } | ||
|
|
||
| ; Function Attrs: convergent | ||
| define internal spir_func ptr addrspace(3) @__sycl_allocateLocalMemoryIndirect() { | ||
| entry: | ||
| %1 = tail call spir_func ptr addrspace(3) @__sycl_dynamicLocalMemoryPlaceholder(i64 128) #1 | ||
| ret ptr addrspace(3) %1 | ||
| } | ||
|
|
||
| ; Function Attrs: convergent | ||
| declare dso_local spir_func ptr addrspace(3) @__sycl_allocateLocalMemory(i64, i64) local_unnamed_addr #1 | ||
|
|
||
| ; Function Attrs: convergent | ||
| declare dso_local spir_func ptr addrspace(3) @__sycl_dynamicLocalMemoryPlaceholder(i64) local_unnamed_addr #1 | ||
|
|
||
| ; CHECK: #[[ATTRS]] = {{.*}} "sycl-work-group-static" | ||
| ; CHECK: #[[FULL_DYNAMIC_MEM_ATTRS]] = {{.*}} "sycl-work-group-scratch" "sycl-work-group-static" | ||
| ; CHECK: #[[DYNAMIC_MEM_ATTRS]] = {{.*}} "sycl-work-group-scratch" "sycl-work-group-static" | ||
| ; CHECK: #[[STATIC_MEM_ATTRS]] = {{.*}} "sycl-work-group-static" | ||
| attributes #0 = { convergent norecurse "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" "unsafe-fp-math"="false" "use-soft-float"="false" "sycl-work-group-static"="1" } | ||
| attributes #1 = { convergent norecurse } | ||
|
|
||
|
lbushi25 marked this conversation as resolved.
|
||
|
|
||
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.