mutable dispatch related fixes - #2143
Conversation
c26f9eb to
2cdd0eb
Compare
…heck the test checks 'cl_khr_extended_versioning' then immediately calls: get_extension_version(device, "cl_khr_command_buffer_mutable_dispatch"); .. however, get_extension_version throws an exception when called with unsupported extension.
the test uses CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, but does not check for support.
test MutableDispatchGlobalSize was failing (with an implementation that doesn't support non-uniform WGs), because the update_global_size = 3 was not a multiple of the local work-size. Fixed by increasing the global work-size to 256K and update size to 16K. This should work with all devices that have max_work_group_size <= 16K. Updates also MutableDispatchWorkGroups which had an out-of-bounds access, because it hardcoded the value of global work-size.
2cdd0eb to
a2fc5d8
Compare
There was a problem hiding this comment.
Sorry it's taken me a while to re-review this.
My main thought from looking at this again is whether we need to be using as many as 256K and 16K work items for the test, which is quite a big increase on what we had before. I'm not sure if on embedded devices or simulators that would slow the test time down and not really give us that much extra testing coverage of the extension. Could we use work item sizes that are an order of magnitude less but still resolve the issues you've seen?
| const size_t update_global_size = 16 * 1024; | ||
| const size_t sizeToAllocate = global_work_size * sizeof(cl_int); | ||
| const size_t num_elements = global_work_size; |
There was a problem hiding this comment.
The sizeToAllocate issue was already fixed by #2437
Unless update_global_size needs to be modified, I believe these changes are no longer required.
There was a problem hiding this comment.
IIRC the update_global_size change was the main motivation of the PR. In the original code, the updated global size (3) is not a divisor of the initial global size (4*16). Is this expected to work even when the implementation doesn't support non-uniform workgroups ?
There was a problem hiding this comment.
Note that this test is changing the global work size, not the local work size, and that the local work size recorded into the command buffer is initially nullptr:
It is not modified by the mutable command update, so it remains nullptr:
Therefore, I don't think there is any requirement to support non-uniform work-groups to run this test. Do you agree?
There was a problem hiding this comment.
OK, that part of mutable dispatch was unclear to me. But i agree with your explanation.
Therefore there is no need to keep the update_global_size related changes of this PR, the issue is in our implementation.
If all the other changes are already fixed, we can close this PR.
There was a problem hiding this comment.
Cool, if you do find that any of these fixes are still needed, feel free to re-open this PR (or open another new PR if it'd be easier). Thanks!
| if ((mutable_capabilities & CL_MUTABLE_DISPATCH_ARGUMENTS_KHR) == 0) | ||
| return true; |
There was a problem hiding this comment.
I believe these changes are all covered elsewhere now.
We removed this Skip function in #2498, since it was already covered in a base class.
This check for CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES has already existed in the Skip check in the base class, see:
No description provided.