Skip to content
New issue

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

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

Already on GitHub? # to your account

setting kernel arguments before recording it in command buffer #1329

Open
aharon-abramson opened this issue Mar 3, 2025 · 2 comments
Open
Labels
cl_khr_command_buffer Relating to the command-buffer family of extension

Comments

@aharon-abramson
Copy link
Contributor

Currently, the specification for clCommandNDRangeKernelKHR says:

kernel is a valid kernel object which must have its arguments set.

This is indeed true if cl_khr_command_buffer_mutable_dispatch is not supported. However, our implementation does support this extension, and in our use cases, we don't know at least some of the kernel's arguments at recording time.
I suggest to specify in cl_khr_command_buffer_mutable_dispatch that when recording an ND-range kernel command, kernel's arguments don't have to be set (of course, all of them must be set when the command buffer is replayed).

@EwanC EwanC added the cl_khr_command_buffer Relating to the command-buffer family of extension label Mar 4, 2025
@joshqti
Copy link
Contributor

joshqti commented Mar 6, 2025

Can we add a state called RECORDED, which would precede finalized. A command buffer can be observed in the RECORDED state. It would be observed to be in RECORDED if clFinalizeCommandBufferKHR is called but not all arguments are set. Attempting to enqueue a command buffer in the RECOREDED state will return CL_INVALID_OPERATION.

As soon as all arguments are set the command buffer state moves to FINALIZED.

@aharon-abramson
Copy link
Contributor Author

We already have a state called Recording that comes before finalization. We need a state named Finalized, which means that the command buffer has been finalized but at least one ND-range kernel command doesn't have all its arguments set. Once all these commands have all their arguments set, or if this is the case before finalization, the command buffer will enter the Executable state.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cl_khr_command_buffer Relating to the command-buffer family of extension
Projects
None yet
Development

No branches or pull requests

3 participants