Skip to content

Commit 650ba7e

Browse files
author
Ewan Crawford
committed
Move simultaneous-use optional feature to mutable-dispatch
1 parent 5073741 commit 650ba7e

5 files changed

Lines changed: 47 additions & 24 deletions

api/cl_khr_command_buffer.asciidoc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ There are no gurantees made around the values of sync-points returned from
122122
adding commands to a command-buffer. Any semantics that a could be inferred
123123
from the sync-point values returned is implementation defined.
124124

125-
==== Simultaneous Use
126-
127-
The optional <<simultaneous-use, simultaneous use>> capability was added to the
128-
extension so that vendors could support concurrent execution of the same
129-
command-buffer. However, simultaneous use may result in command-buffers having
130-
a larger overhead to implement, so the capability is optional to enable
131-
optimizations when this usage isn't required by a user.
132-
133125
=== Interactions With Other Extensions
134126

135127
The introduction of the command-buffer abstraction enables functionality
@@ -240,11 +232,8 @@ features:
240232
* {cl_device_command_buffer_capabilities_khr_TYPE}
241233
** {CL_COMMAND_BUFFER_CAPABILITY_KERNEL_PRINTF_KHR}
242234
** {CL_COMMAND_BUFFER_CAPABILITY_DEVICE_SIDE_ENQUEUE_KHR}
243-
** {CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR}
244235
* {cl_command_buffer_properties_khr_TYPE}
245236
** {CL_COMMAND_BUFFER_FLAGS_KHR}
246-
* {cl_command_buffer_flags_khr_TYPE}
247-
** {CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR}
248237
* {cl_command_buffer_info_khr_TYPE}
249238
** {CL_COMMAND_BUFFER_QUEUES_KHR}
250239
** {CL_COMMAND_BUFFER_NUM_QUEUES_KHR}

api/cl_khr_command_buffer_mutable_dispatch.asciidoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include::{generated}/meta/{refprefix}cl_khr_command_buffer_mutable_dispatch.txt[
66
=== Other Extension Metadata
77

88
*Last Modified Date*::
9-
2024-09-05
9+
2025-08-08
1010
*IP Status*::
1111
No known IP claims.
1212
*Contributors*::
@@ -41,6 +41,15 @@ This allows inputs and outputs to the kernel, as well as work-item sizes and
4141
offsets, to change without having to re-record the entire command sequence
4242
in a new command-buffer.
4343

44+
==== Simultaneous Use
45+
46+
The optional <<simultaneous-use, simultaneous use>> capability was added to the
47+
extension so that vendors could support concurrent execution of the same
48+
command-buffer object which has been updated between submissions. However,
49+
simultaneous use may result in command-buffers having a larger overhead to
50+
implement, so the capability is optional to enable optimizations when this
51+
usage isn't required by a user.
52+
4453
=== Interactions With Other Extensions
4554

4655
The {clUpdateMutableCommandsKHR} entry-point has been designed for the purpose
@@ -72,6 +81,8 @@ void pointer using {cl_command_buffer_update_type_khr_TYPE}.
7281

7382
* {cl_device_info_TYPE}
7483
** {CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR}
84+
* {cl_device_command_buffer_capabilities_khr_TYPE}
85+
** {CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR}
7586
* {cl_command_properties_khr_TYPE}
7687
** {CL_MUTABLE_DISPATCH_ASSERTS_KHR}
7788
** {CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR}
@@ -95,6 +106,7 @@ void pointer using {cl_command_buffer_update_type_khr_TYPE}.
95106
** {CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR}
96107
* {cl_command_buffer_flags_khr_TYPE}
97108
** {CL_COMMAND_BUFFER_MUTABLE_KHR}
109+
** {CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR}
98110
* {cl_command_buffer_properties_khr_TYPE}
99111
** {CL_COMMAND_BUFFER_MUTABLE_DISPATCH_ASSERTS_KHR}
100112
* {cl_command_buffer_update_type_khr_TYPE}
@@ -363,3 +375,7 @@ may be a introduced as a stand alone extension.
363375
* Revision 0.9.3, 2024-09-05
364376
** Rename `CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR` to
365377
`CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR` (experimental).
378+
* Revision 0.9.4, 2025-08-08
379+
** Move `CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR` and
380+
`CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR` in this
381+
extension from the base extension (experimental).

api/opencl_platform_layer.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,11 +1790,13 @@ include::{generated}/api/version-notes/CL_COMMAND_BUFFER_CAPABILITY_KERNEL_PRINT
17901790

17911791
include::{generated}/api/version-notes/CL_COMMAND_BUFFER_CAPABILITY_DEVICE_SIDE_ENQUEUE_KHR.asciidoc[]
17921792

1793+
ifdef::cl_khr_command_buffer_mutable_dispatch[]
17931794
{CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR_anchor} Device
17941795
supports enqueueing command-buffers with a <<simultaneous-use,
17951796
simultaneous use>> usage pattern.
17961797

17971798
include::{generated}/api/version-notes/CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR.asciidoc[]
1799+
endif::cl_khr_command_buffer_mutable_dispatch[]
17981800

17991801
ifdef::cl_khr_command_buffer_multi_device[]
18001802
{CL_COMMAND_BUFFER_CAPABILITY_MULTIPLE_QUEUE_KHR_anchor} Device

api/opencl_runtime_layer.asciidoc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14692,10 +14692,17 @@ usage>>.
1469214692
====
1469314693

1469414694
Simultaneous use is defined using the _prerequisite_ terminology from the
14695-
<<_execution_model, execution model>>, and is an optional feature for devices
14696-
to support concurrent executions of a command-buffer. A command-buffer must
14697-
be created with {CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR} to avoid undefined
14698-
behavior if a simultaneous use usage pattern occurs.
14695+
<<_execution_model, execution model>>.
14696+
ifndef::cl_khr_command_buffer_multi_device[]
14697+
A command-buffer exhibits undefined behavior if a simultaneous use usage
14698+
pattern occurs.
14699+
endif::cl_khr_command_buffer_multi_device[]
14700+
ifdef::cl_khr_command_buffer_multi_device[]
14701+
Simultaneous use is an optional feature for devices to support concurrent
14702+
executions of a command-buffer which have been updated between submissions.
14703+
A command-buffer must be created with {CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR}
14704+
to avoid undefined behavior if a simultaneous use usage pattern occurs.
14705+
endif::cl_khr_command_buffer_multi_device[]
1469914706

1470014707
[[simultaneous-use]]
1470114708
Simultaneous Use:: When a command-buffer is submitted for
@@ -14708,9 +14715,7 @@ An example of simultaneous use would be two submissions of the same
1470814715
command-buffer to a single out-of-order queue, without any events or barriers
1470914716
used to express a dependency between the two enqueue calls. Using a single
1471014717
in-order queue, events, or barriers to express dependencies between submissions
14711-
of the same command-buffer would each be ways to avoid simultaneous use and are
14712-
valid usage of command-buffers created without the
14713-
{CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR} flag.
14718+
of the same command-buffer would each be ways to avoid simultaneous use.
1471414719
====
1471514720

1471614721
ifdef::cl_khr_command_buffer_multi_device[]
@@ -14820,13 +14825,15 @@ include::{generated}/api/version-notes/CL_COMMAND_BUFFER_FLAGS_KHR.asciidoc[]
1482014825
| {cl_command_buffer_flags_khr_TYPE}
1482114826
| This is a bitfield and can be set to a combination of the following values:
1482214827

14828+
ifdef::cl_khr_command_buffer_mutable_dispatch[]
1482314829
{CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR_anchor} - Allow multiple
1482414830
instances of the command-buffer to be scheduled for execution on the
1482514831
device in a usage pattern that exhibits <<simultaneous-use,
1482614832
simultaneous use>>. If set, devices must support
1482714833
{CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR}.
1482814834

1482914835
include::{generated}/api/version-notes/CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR.asciidoc[]
14836+
endif::cl_khr_command_buffer_mutable_dispatch[]
1483014837

1483114838
ifdef::cl_khr_command_buffer_multi_device[]
1483214839
{CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR_anchor} - All commands in the
@@ -15120,10 +15127,17 @@ execution was successfully queued, or one of the errors below:
1512015127
required by the OpenCL implementation on the host.
1512115128
--
1512215129

15130+
ifndef::cl_khr_command_buffer_mutable_dispatch[]
15131+
Calling {clEnqueueCommandBufferKHR} in a usage pattern that exhbits
15132+
<<simultaneous-use, simultaneous use>> results in undefined behavior.
15133+
endif::cl_khr_command_buffer_mutable_dispatch[]
15134+
15135+
ifdef::cl_khr_command_buffer_mutable_dispatch[]
1512315136
Calling {clEnqueueCommandBufferKHR} in a usage pattern that exhbits
1512415137
<<simultaneous-use, simultaneous use>> when _command_buffer_ was not created
1512515138
with the {CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR} flag results in undefined
1512615139
behavior.
15140+
endif::cl_khr_command_buffer_mutable_dispatch[]
1512715141

1512815142
=== Recording Commands to a Command-Buffer
1512915143

xml/cl.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7346,14 +7346,10 @@ server's OpenCL/api-docs repository.
73467346
<require comment="cl_device_command_buffer_capabilities_khr - bitfield">
73477347
<enum name="CL_COMMAND_BUFFER_CAPABILITY_KERNEL_PRINTF_KHR"/>
73487348
<enum name="CL_COMMAND_BUFFER_CAPABILITY_DEVICE_SIDE_ENQUEUE_KHR"/>
7349-
<enum name="CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR"/>
73507349
</require>
73517350
<require comment="cl_command_buffer_properties_khr">
73527351
<enum name="CL_COMMAND_BUFFER_FLAGS_KHR"/>
73537352
</require>
7354-
<require comment="cl_command_buffer_flags_khr - bitfield">
7355-
<enum name="CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR"/>
7356-
</require>
73577353
<require comment="Error codes">
73587354
<enum name="CL_INVALID_COMMAND_BUFFER_KHR"/>
73597355
<enum name="CL_INVALID_SYNC_POINT_WAIT_LIST_KHR"/>
@@ -7469,7 +7465,7 @@ server's OpenCL/api-docs repository.
74697465
<enum name="CL_QUEUE_JOB_SLOT_ARM"/>
74707466
</require>
74717467
</extension>
7472-
<extension name="cl_khr_command_buffer_mutable_dispatch" revision="0.9.3" supported="opencl" depends="cl_khr_command_buffer" ratified="opencl" experimental="true" comment="requires cl_khr_command_buffer 0.9.5 or later">
7468+
<extension name="cl_khr_command_buffer_mutable_dispatch" revision="0.9.4" supported="opencl" depends="cl_khr_command_buffer" ratified="opencl" experimental="true" comment="requires cl_khr_command_buffer 0.9.8 or later">
74737469
<require>
74747470
<type name="CL/cl.h"/>
74757471
</require>
@@ -7483,8 +7479,14 @@ server's OpenCL/api-docs repository.
74837479
<type name="cl_mutable_dispatch_asserts_khr"/>
74847480
</require>
74857481
<require comment="cl_command_buffer_flags_khr - bitfield">
7482+
<enum name="CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR"/>
74867483
<enum name="CL_COMMAND_BUFFER_MUTABLE_KHR"/>
74877484
</require>
7485+
7486+
<require comment="cl_device_command_buffer_capabilities_khr - bitfield">
7487+
<enum name="CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR"/>
7488+
</require>
7489+
74887490
<require comment="Error codes">
74897491
<enum name="CL_INVALID_MUTABLE_COMMAND_KHR"/>
74907492
</require>

0 commit comments

Comments
 (0)