fix subgroup ballot testing for non-uniform workgroups#2709
Open
karolherbst wants to merge 2 commits into
Open
fix subgroup ballot testing for non-uniform workgroups#2709karolherbst wants to merge 2 commits into
karolherbst wants to merge 2 commits into
Conversation
6431eeb to
d1603ca
Compare
While the workgroup could be non-uniform, we could end up with uniform subgroup sizes. E.g. with local = 168 and subgroup_size = 8 This helps debugging the subgroup tests with non uniform subgroups, because one could test with uniform subgroup sizes to narrow down the actual implementation bug.
The return value of get_sub_group_size() is implementation defined and might not return the actual size of the sub groups on the edges of a non- uniform workgroup. Closes: KhronosGroup#1198
d1603ca to
74237f8
Compare
rjodinchr
approved these changes
Jun 2, 2026
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.
The first patch is fixing a simple logic mistake when calculating the amount of sub-groups in the very unlikely case that a local size of 170 creates only uniform subgroups (e.g. when the subgroup size is 2).
The second test solves a edge case behavior with
get_sub_group_size()because it's return value is actually implementation defined as per the OpenCL C spec: and it's legal to return e.g. 8 for a sub-group with just 2 work-items.