Skip to content

CTS updates for reworked simultaneous use#2477

Merged
bashbaug merged 4 commits intoKhronosGroup:mainfrom
EwanC:reword_sim-use
Oct 14, 2025
Merged

CTS updates for reworked simultaneous use#2477
bashbaug merged 4 commits intoKhronosGroup:mainfrom
EwanC:reword_sim-use

Conversation

@EwanC
Copy link
Contributor

@EwanC EwanC commented Aug 8, 2025

Actions test plan from #2473 to update CTS tests to reflect changes from cl_khr_command_buffer PR KhronosGroup/OpenCL-Docs#1411

  • Adds new test incommand_buffer_pipelined_enqueue.cpp for multiple enqueues without blocking in-between, but serialized execution.
  • Removed test for CL_COMMAND_BUFFER_STATE_PENDING_KHR state query.
  • Remove negative test for clEnqueueCommandBuffer pending state error.
  • Simplify cl_khr_command_buffer tests that stress simultaneous-use by testing multiple serialized enqueues of the same command-buffer, which doesn't now require the device imultaneous-use capability
  • Remove simultaneous-use command-buffer creation in base class to off, and require tests do it themselves if they require it.
  • Rewrite mutable dispatch simultaneous test to test updating both pipelined enqueues, and updating the new definition of simultaneous-use

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is worth paying attention to in review, it adds new tests that cover cases that could have been considered simultaneous-use in the previous definition, but now are not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is worth paying attention to in review, it tests updating a command-buffer which may still be executing as there are no blocking waits between enqueues.

@EwanC EwanC marked this pull request as ready for review August 26, 2025 16:25
ahesham-arm pushed a commit that referenced this pull request Aug 27, 2025
This is a very small subset of the changes in #2477 to get things
building again, since the command-buffer pending state is no longer in
the spec or headers.
Ewan Crawford added 2 commits September 8, 2025 08:26
Actions test plan from KhronosGroup#2473
to update CTS tests to reflect changes from cl_khr_command_buffer PR
KhronosGroup/OpenCL-Docs#1411

* Adds new test in`command_buffer_pipelined_enqueue.cpp` for multiple enqueues without
  blocking in-between, but serialized execution.
* Removed test for `CL_COMMAND_BUFFER_STATE_PENDING_KHR` state query.
* Remove negative test for `clEnqueueCommandBuffer` pending state error.
* Simplify `cl_khr_command_buffer` tests that stress simultaneous-use by testing
  multiple serialized enqueues of the same command-buffer, which doesn't
  now require the device imultaneous-use capability
* Remove simultaneous-use command-buffer creation in base
  class to off, and require tests do it themselves if they require it.
* Rewrite mutable dispatch simultaneous test to test updating both
  pipelined enqueues, and updating the new definition of simultaneous-use
bashbaug
bashbaug previously approved these changes Sep 8, 2025
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.

I've run these tests with the command buffer emulation layer and I'm not seeing any unexpected failures, although it would be most interesting for somebody to run these tests on an implementation that does not support simultaneous use.

@rjodinchr
Copy link
Contributor

That PR is working using kpet/clvk#807 (which does not support simultaneous use).

bashbaug
bashbaug previously approved these changes Sep 11, 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
test_error(error, "clEnqueueCommandBufferKHR failed");

std::vector<cl_int> output_data(num_elements);
error = clEnqueueReadBuffer(out_of_order_queue, out_mem, CL_TRUE, 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello Ewan, sorry for not catching this earlier, but I believe there needs to be a barrier before the clEnqueueReadBuffer, as there is no guarantee it will wait until all work is done (out of order queue).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice spot, I've pushed a commit adding a barrier in for that missing synchronization.

Needs synchronization between final command-buffer enqueue
and buffer read
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.

Merging as discussed in the October 14th teleconference.

@bashbaug bashbaug merged commit bfa96c7 into KhronosGroup:main Oct 14, 2025
8 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants