KhronosGroup / KhronosGroup/OpenCL-Docs
Introduce command-buffer functionality to update cl_kernel in kernel command
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
This is a feature request to enable updating the `cl_kernel` argument to `clCommandNDRangeKernelKHR` commands with `clUpdateMutableCommandsKHR`. This can be done by extending the [cl_khr_command_buffer_mutable_dispatch](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#cl_khr_command_buffer_mutable_dispatch) extension, or creating a layered extension ontop of cl_khr_command_buffer_mutable_dispatch.
This request is based on a desire to use OpenCL as a backend to support an equivalent feature in SYCL-Graph (See https://github.com/intel/llvm/pull/14896 & https://github.com/intel/llvm/pull/15700). The other SYCL-Graph backends implement this feature using similar functionality to this feature request:
* CUDA-Graph - via [cudaGraphExecKernelNodeSetParams](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g119efd892d546aece0d7ebe48c37b02b), setting `void * cudaKernelNodeParams::func`.
* Level Zero - via [zeCommandListUpdateMutableCommandKernelsExp](https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/api.html#zecommandlistupdatemutablecommandkernelsexp). Note that when getting a handle to a kernel command in Level Zero, the list of possible kernels that are valid to update with must be passed (see [zeCommandListGetNextCommandIdWithKernelsExp](https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/api.html#zecommandlistgetnextcommandidwithkernelsexp). If we want to follow a similar design, then an equivalent list can be passed via the `properties` parameter to `clCommandNDRangeKernelKHR`.
Contributor guide
Research direction
Start with the cl_khr_command_buffer_mutable_dispatch extension and the clCommandNDRangeKernelKHR and clUpdateMutableCommandsKHR APIs in the OpenCL specification. Compare the CUDA Graph and Level Zero update mechanisms cited in the issue, including how valid kernels could be passed through properties. Done means reaching agreement on an extension design and documenting the resulting API behavior.
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