Skip to content

fix subgroup ballot testing for non-uniform workgroups#2709

Open
karolherbst wants to merge 2 commits into
KhronosGroup:mainfrom
karolherbst:fix/subgroups
Open

fix subgroup ballot testing for non-uniform workgroups#2709
karolherbst wants to merge 2 commits into
KhronosGroup:mainfrom
karolherbst:fix/subgroups

Conversation

@karolherbst
Copy link
Copy Markdown
Contributor

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.

Returns the number of work-items in the sub-group. This value is no more than the maximum sub-group size and is implementation-defined based on a combination of the compiled kernel and the dispatch dimensions. This will be a constant value for the lifetime of the sub-group.

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
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