KhronosGroup / KhronosGroup/OpenCL-Docs
Simultaneous update capability to mutable dispatch
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
Currently the specification for `cl_khr_command_buffer_mutable_dispatch` does not specify whether `clUpdateMutableCommandsKHR` can be called while an instance of the command-buffer is being executed.
Some implementations may not support this behavior and require the command-buffer to not being executing in order to update its commands arguments.
I suggest adding similar flag and capability as the ones added for simultaneous use https://github.com/KhronosGroup/OpenCL-Docs/issues/891. And require the developers to wait on the previous submissions of the command buffer to reach `CL_COMPLETE` state before calling `clUpdateMutableCommandsKHR` if the simultaneous update capability is not supported.
E.g. with simultaneous update
```
clEnqueueCommandBufferKHR(1, &queue, cmdbuf, 0, NULL, &event);
clUpdateMutableCommandsKHR(cmdbuf, 1, &config_type, &config);
clEnqueueCommandBufferKHR(1, &queue, cmdbuf, 1, &event, NULL);
```
E.g. without simultaneous update
```
clEnqueueCommandBufferKHR(1, &queue, cmdbuf, 0, NULL, NULL);
clFinish(queue)
clUpdateMutableCommandsKHR(cmdbuf, 1, &config_type, &config);
clEnqueueCommandBufferKHR(1, &queue, cmdbuf, 0, NULL, NULL);
```
Contributor guide
Research direction
Start with the specification for cl_khr_command_buffer_mutable_dispatch and compare the simultaneous-use capability discussed in issue 891. Review the clUpdateMutableCommandsKHR and clEnqueueCommandBufferKHR examples in this issue, then determine the required capability flag and execution-completion rule. Done means the specification unambiguously defines whether updates during execution are supported and what callers must do when they are not.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100