Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXP][Command-Buffer] Add kernel command update #1089

Merged
merged 1 commit into from
Feb 13, 2024

Commits on Feb 13, 2024

  1. [EXP][Command-Buffer] Add kernel command update

    This change introduces a new API that allows the kernel commands of a command-buffer to be updated
    with a new configuration. For example, modified arguments or ND-Range.
    
    The new API is defined in the following files and then source generated using scripts, so reviewers should look at:
    * `scripts/core/EXP-COMMAND-BUFFER.rst`
    * `scripts/core/exp-command-buffer.yml`
    
    See [cl_khr_command_buffer_mutable_dispatch](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_command_buffer_mutable_dispatch) as prior art. The differences between the proposed API and the above are:
    
    * Only the append kernel entry-point returns a command handle. I imagine this will be changed in future to enable other commands to do update.
    * USM,  buffer, and scalar arguments can be updated, there is not equivalent update struct for `urKernelSetArgLocal` or `urKernelSetArgSampler`
    * There is no granularity of optional support for update, an implementer must either implement all the ways to update a kernel configuration, or none of them.
    * Command-handles are reference counted in UR, and extend the lifetime of the parent command-buffer.
    
    The CUDA adapter is the only adapter that currently implements this new feature, other adapters don't report support. This is because CUDA is already an adapter supported by UR command-buffers, and the CUDA API for updating nodes already exists as a non-optional feature.
    
    Reviewers should review the changes in `source/adapters/cuda/` to evaluate this,
    
    CTS tests are written to verify implementation, as there is not yet a DPC++ feature with testing to stress the code path (see reble/llvm#340 for how that feature could look).
    
    A new test directory has been created to test the command-buffer experimental feature, `test/conformance/exp_command_buffer`, which contains tests to stress using the feature defined by this extension so that it has code coverage. Reviewers should look at the new tests added here, and new device kernels in `test/conformance/device_code` to evaluate these changes.
    EwanC committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    fbdaf72 View commit details
    Browse the repository at this point in the history