Skip to content

Fixup command-buffer enqueue error after PR-1382#1471

Merged
bashbaug merged 1 commit intoKhronosGroup:mainfrom
EwanC:cmd-buf_defered_args_enqueue
Oct 14, 2025
Merged

Fixup command-buffer enqueue error after PR-1382#1471
bashbaug merged 1 commit intoKhronosGroup:mainfrom
EwanC:cmd-buf_defered_args_enqueue

Conversation

@EwanC
Copy link
Contributor

@EwanC EwanC commented Oct 7, 2025

#1382 added support for deferring setting arguments on a kernel command which is updatable. To achieve this we added an extra command-buffer state, "finalized" which is entered when a command-buffer has been finalized but doesn't yet have all it's arguments set.

However, if a user tries to enqueue a command-buffer in this state it shouldn't be valid. Therefore update our current wording about when an command-buffer can be enqueued to say the specifically the executable state, when all the arguments are set. Rather than defined as only after the finalization operation, which could result in the command-buffer being in either the finalization or executable state.

We have a NOTE a few lines above to this effect already, which I'm not really sure

KhronosGroup#1382 added support
for deferring setting arguments on a kernel command which is updatable.
To achieve this we added an extra command-buffer state, "finalized"
which is entered when a command-buffer has been finalized but doesn't
yet have all it's arguments set.

However, if a user tries to enqueue a command-buffer in this state
it shouldn't be valid. Therefore update our current wording about
when an command-buffer can be enqueued to say the specifically the executable
state, when all arguments are available. Rather than defined as after the
finalization operation, which could result in the command-buffer being in
either the finalization or executable state.

We already have a NOTE above to this effect, which I've removed as it
felt like it didn't add any extra value above the error definition, but
can added back if folks think it's worthwhile.
@EwanC EwanC added the cl_khr_command_buffer Relating to the command-buffer family of extension label Oct 7, 2025
EwanC added a commit to EwanC/OpenCL-CTS that referenced this pull request Oct 7, 2025
Tests the scenario outlined in
KhronosGroup#2520 (comment)
to verify the functionality added in OpenCL-Docs PR
KhronosGroup/OpenCL-Docs#1382.

Note that this bumps the required cl_khr_command_buffer_mutable_dispatch
minor version by 2 because
KhronosGroup#2477 is not yet merged
which test the intermediate version.

This also assumes the proposed OpenCL-Docs change in
KhronosGroup/OpenCL-Docs#1471 is merged, as
the PR does a negative test for command-buffer enqueue while the
command-buffer is in the finalized state.

Closes KhronosGroup#2520
Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@bashbaug
Copy link
Contributor

Merging as discussed in the October 14th teleconference.

@bashbaug bashbaug merged commit 4d4bb08 into KhronosGroup:main Oct 14, 2025
2 checks passed
EwanC added a commit to EwanC/OpenCL-CTS that referenced this pull request Oct 17, 2025
Tests the scenario outlined in
KhronosGroup#2520 (comment)
to verify the functionality added in OpenCL-Docs PR
KhronosGroup/OpenCL-Docs#1382.

Note that this bumps the required cl_khr_command_buffer_mutable_dispatch
minor version by 2 because
KhronosGroup#2477 is not yet merged
which test the intermediate version.

This also assumes the proposed OpenCL-Docs change in
KhronosGroup/OpenCL-Docs#1471 is merged, as
the PR does a negative test for command-buffer enqueue while the
command-buffer is in the finalized state.

Closes KhronosGroup#2520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cl_khr_command_buffer Relating to the command-buffer family of extension

Projects

Development

Successfully merging this pull request may close these issues.

2 participants