Skip to content

Commit 91c4a0d

Browse files
Ewan Crawfordbashbaug
andauthored
cl_khr_command_buffer sync-point capacity (#1286)
* cl_khr_command_buffer sync-point capacity Document the behaviour when command-buffer command capacity is reached, and track under "Issues" the possible future use-cases for being able to optimize based on the capacity of a command-buffer. Closes #844 * Refine out-of-order command-buffer enqueue wording * Update api/cl_khr_command_buffer.asciidoc Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com> --------- Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
1 parent 03acab5 commit 91c4a0d

1 file changed

Lines changed: 36 additions & 10 deletions

File tree

api/cl_khr_command_buffer.asciidoc

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ Command-buffers enable a reduction in overhead when enqueuing the same
4343
workload multiple times. By separating the command-queue setup from dispatch,
4444
the ability to replay a set of previously created commands is introduced.
4545

46-
Device-side _cl_sync_point_khr_ synchronization-points can be used within
47-
command-buffers to define command dependencies. This allows the commands of a
48-
command-buffer to execute out-of-order on a single <<compatible, compatible>>
49-
command-queue. The command-buffer itself has no inherent in-order/out-of-order
50-
property, this ordering is inferred from the command-queue used on command
51-
recording. Out-of-order enqueues without event dependencies of both regular
52-
commands, such as {clEnqueueFillBuffer}, and command-buffers are allowed to
53-
execute concurrently, and it is up to the user to express any dependencies using
54-
events.
55-
5646
The command-queues a command-buffer will be executed on can be set on replay via
5747
parameters to {clEnqueueCommandBufferKHR}, provided they are
5848
<<compatible, compatible>> with the command-queues used on command-buffer
@@ -110,6 +100,29 @@ following reasons:
110100
other extensions layered on top to take advantage of them to provide additional
111101
mutable functionality.
112102

103+
==== Command Synchronization
104+
105+
Device-side {cl_sync_point_khr_TYPE} synchronization-points can be used within
106+
command-buffers to define command dependencies. This allows the commands of a
107+
command-buffer to execute out-of-order on a single <<compatible, compatible>>
108+
command-queue. The command-buffer itself has no inherent in-order/out-of-order
109+
property, this ordering is inferred from the command-queue used on command
110+
recording. {clEnqueueCommandBufferKHR} submissions to an out-of-order queue
111+
have the same execution semantics are other operations enqueued to an
112+
out-of-order queue, such as {clEnqueueFillBuffer}, where execution between
113+
enqueued operations may happen concurrently unless dependencies between the
114+
operations are expressed with events.
115+
116+
The {cl_sync_point_khr_TYPE} type is defined as a `cl_uint`, giving a hard
117+
upper limit on the number of commands a command-buffer can hold as
118+
{CL_UINT_MAX}, at which point {CL_OUT_OF_RESOURCES} will be returned. However,
119+
it is likely an implementation will reach capacity before this threshold is
120+
hit.
121+
122+
There are no gurantees made around the values of sync-points returned from
123+
adding commands to a command-buffer. Any semantics that a could be inferred
124+
from the sync-point values returned is implementation defined.
125+
113126
==== Simultaneous Use
114127

115128
The optional simultaneous use capability was added to the extension so that
@@ -420,6 +433,19 @@ features:
420433
--
421434
*UNRESOLVED*
422435
--
436+
. Give users more control over command-buffer command capacity via some or all
437+
of the following mechanisms.
438+
** Provide a way for a user to query a command-buffer for the maximum number
439+
of commands it can hold.
440+
** Guarantee a minimum command capacity that an implementation must support.
441+
** Provide a mechanism for users to reserve command-buffer capacity on
442+
command-buffer creation.
443+
444+
+
445+
--
446+
*RESOLVED* - Mechanisms to achieve this could be provided as a layered extension.
447+
--
448+
423449

424450
=== Version History
425451

0 commit comments

Comments
 (0)