Skip to content

Commit cafe3df

Browse files
committed
Add properties parameter to all command-buffer commands
See Issue KhronosGroup#1207 disucssion how it could make the `cl_khr_command_buffer` extension more extensible if we allowed all the command-recording parameters to have a `properties` parameter that could be used.
1 parent 6be4f45 commit cafe3df

File tree

5 files changed

+95
-20
lines changed

5 files changed

+95
-20
lines changed

api/cl_khr_command_buffer.asciidoc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
include::{generated}/meta/{refprefix}cl_khr_command_buffer.txt[]
55

66
// *Revision*::
7-
// 0.9.4
7+
// 0.9.5
88
// *Extension and Version Dependencies*::
99
// This extension requires OpenCL 1.2 or later.
1010
// Buffering of SVM commands requires OpenCL 2.0 or later.
1111

1212
=== Other Extension Metadata
1313

1414
*Last Modified Date*::
15-
2023-03-31
15+
2024-07-24
1616
*IP Status*::
1717
No known IP claims.
1818
*Contributors*::
@@ -137,13 +137,15 @@ retain its provisional extension status until other layered extensions are
137137
released, as these may reveal modifications needed to the base specification to
138138
support their intended use cases.
139139

140-
==== ND-range Kernel Command Properties
140+
==== Command Properties
141141

142-
The {clCommandNDRangeKernelKHR} entry-point defines a `properties` parameter of
143-
new type {cl_ndrange_kernel_command_properties_khr_TYPE}. No properties are defined
144-
in {cl_khr_command_buffer_EXT}, but the parameter enables layered extensions like
145-
{cl_khr_command_buffer_mutable_dispatch_EXT} to define properties that inform
146-
the characteristics of the kernel command.
142+
The command recording entry-points allow a `properties` parameter of
143+
new type {cl_command_properties_khr_TYPE} to be passed. No properties are
144+
defined in {cl_khr_command_buffer_EXT}, but the parameter enables layered
145+
extensions to define characterisitcs of the individual commands.
146+
147+
For example, {cl_khr_command_buffer_mutable_dispatch_EXT} defines properties
148+
that can be set when appending a kernel command with {clCommandNDRangeKernelKHR}.
147149

148150
==== Command Handles
149151

@@ -214,7 +216,7 @@ features:
214216
* {cl_command_buffer_state_khr_TYPE}
215217
* {cl_command_buffer_properties_khr_TYPE}
216218
* {cl_command_buffer_flags_khr_TYPE}
217-
* {cl_ndrange_kernel_command_properties_khr_TYPE}
219+
* {cl_command_properties_khr_TYPE}
218220
* {cl_mutable_command_khr_TYPE}
219221

220222
=== New Enums
@@ -433,4 +435,7 @@ features:
433435
* 0.9.4, 2023-05-11
434436
** Add clCommandSVMMemcpyKHR and clCommandSVMMemFillKHR command entries
435437
(provisional).
438+
* 0.9.5, 2024-07-24
439+
** Add a properties parameter to all command recording entry-points
440+
(provisional).
436441

api/cl_khr_command_buffer_mutable_dispatch.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void pointer using {cl_command_buffer_update_type_khr_TYPE}.
7272

7373
* {cl_device_info_TYPE}
7474
** {CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR}
75-
* {cl_ndrange_kernel_command_properties_khr_TYPE}
75+
* {cl_command_properties_khr_TYPE}
7676
** {CL_MUTABLE_DISPATCH_ASSERTS_KHR}
7777
** {CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR}
7878
* {cl_mutable_dispatch_asserts_khr_TYPE}
@@ -196,7 +196,7 @@ kernel void vector_addition(global int* tile1, global int* tile2,
196196
CL_CHECK(clSetKernelArg(kernel, 2, sizeof(cl_mem), &output_buffers[0]));
197197
198198
// Instruct the nd-range command to allow for mutable kernel arguments
199-
cl_ndrange_kernel_command_properties_khr mutable_properties[] = {
199+
cl_command_properties_khr mutable_properties[] = {
200200
CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR,
201201
CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0};
202202

api/opencl_runtime_layer.asciidoc

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14326,6 +14326,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1432614326
_command_queue_ is `NULL`, then only one command-queue must have been set on
1432714327
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1432814328
endif::cl_khr_command_buffer_multi_device[]
14329+
* _properties_ specifies a list of properties for the command and their
14330+
corresponding values. Each property name is immediately followed by the
14331+
corresponding desired value. The list is terminated with 0. The
14332+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14333+
supported properties may be defined by layered extensions in future.
1432914334
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
1433014335
synchronization-points that need to complete before this particular
1433114336
command can be executed.
@@ -14388,6 +14393,7 @@ ifdef::cl_khr_command_buffer_multi_device[]
1438814393
associated with _command_queue_ and _command_buffer_ is not the same.
1438914394
endif::cl_khr_command_buffer_multi_device[]
1439014395
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14396+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1439114397
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1439214398
* {CL_INVALID_SYNC_POINT_WAIT_LIST_KHR} if _sync_point_wait_list_ is
1439314399
`NULL` and _num_sync_points_in_wait_list_ is > 0, or
@@ -14420,6 +14426,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1442014426
_command_queue_ is `NULL`, then only one command-queue must have been set on
1442114427
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1442214428
endif::cl_khr_command_buffer_multi_device[]
14429+
* _properties_ specifies a list of properties for the command and their
14430+
corresponding values. Each property name is immediately followed by the
14431+
corresponding desired value. The list is terminated with 0. The
14432+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14433+
supported properties may be defined by layered extensions in future.
1442314434
* _src_buffer_, _dst_buffer_, _src_offset_, _dst_offset_, _size_ refer
1442414435
to {clEnqueueCopyBuffer}.
1442514436
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
@@ -14488,6 +14499,7 @@ New errors:
1448814499
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1448914500
command-buffer.
1449014501
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14502+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1449114503
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1449214504
--
1449314505

@@ -14511,6 +14523,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1451114523
_command_queue_ is `NULL`, then only one command-queue must have been set on
1451214524
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1451314525
endif::cl_khr_command_buffer_multi_device[]
14526+
* _properties_ specifies a list of properties for the command and their
14527+
corresponding values. Each property name is immediately followed by the
14528+
corresponding desired value. The list is terminated with 0. The
14529+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14530+
supported properties may be defined by layered extensions in future.
1451414531
* _src_origin_, _dst_origin_, _region_, _src_row_pitch_,
1451514532
_src_slice_pitch_, _dst_row_pitch_, _dst_slice_pitch_ refer to
1451614533
{clEnqueueCopyBufferRect}.
@@ -14597,6 +14614,7 @@ New errors:
1459714614
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1459814615
command-buffer.
1459914616
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14617+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1460014618
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1460114619
--
1460214620

@@ -14620,6 +14638,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1462014638
_command_queue_ is `NULL`, then only one command-queue must have been set on
1462114639
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1462214640
endif::cl_khr_command_buffer_multi_device[]
14641+
* _properties_ specifies a list of properties for the command and their
14642+
corresponding values. Each property name is immediately followed by the
14643+
corresponding desired value. The list is terminated with 0. The
14644+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14645+
supported properties may be defined by layered extensions in future.
1462314646
* _src_buffer_, _dst_image_, _src_offset_, _dst_origin_, _region_ refer to
1462414647
{clEnqueueCopyBufferToImage}
1462514648
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
@@ -14689,6 +14712,7 @@ New errors:
1468914712
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1469014713
command-buffer.
1469114714
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14715+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1469214716
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1469314717
--
1469414718

@@ -14711,6 +14735,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1471114735
_command_queue_ is `NULL`, then only one command-queue must have been set on
1471214736
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1471314737
endif::cl_khr_command_buffer_multi_device[]
14738+
* _properties_ specifies a list of properties for the command and their
14739+
corresponding values. Each property name is immediately followed by the
14740+
corresponding desired value. The list is terminated with 0. The
14741+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14742+
supported properties may be defined by layered extensions in future.
1471414743
* _src_image_, _dst_image_, _src_origin_, _dst_origin_, _region_ refer to
1471514744
{clEnqueueCopyImage}.
1471614745
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
@@ -14787,6 +14816,7 @@ New errors:
1478714816
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1478814817
command-buffer.
1478914818
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14819+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1479014820
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1479114821
--
1479214822

@@ -14810,6 +14840,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1481014840
_command_queue_ is `NULL`, then only one command-queue must have been set on
1481114841
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1481214842
endif::cl_khr_command_buffer_multi_device[]
14843+
* _properties_ specifies a list of properties for the command and their
14844+
corresponding values. Each property name is immediately followed by the
14845+
corresponding desired value. The list is terminated with 0. The
14846+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14847+
supported properties may be defined by layered extensions in future.
1481314848
* _src_image_, _dst_buffer_, _src_origin_, _region_, _dst_offset_ refer to
1481414849
{clEnqueueCopyImageToBuffer}.
1481514850
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
@@ -14879,6 +14914,7 @@ New errors:
1487914914
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1488014915
command-buffer.
1488114916
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
14917+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1488214918
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1488314919
--
1488414920

@@ -14910,6 +14946,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1491014946
_command_queue_ is `NULL`, then only one command-queue must have been set on
1491114947
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1491214948
endif::cl_khr_command_buffer_multi_device[]
14949+
* _properties_ specifies a list of properties for the command and their
14950+
corresponding values. Each property name is immediately followed by the
14951+
corresponding desired value. The list is terminated with 0. The
14952+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
14953+
supported properties may be defined by layered extensions in future.
1491314954
* _buffer_, _pattern_, _pattern_size_, _offset_, _size_ refer to
1491414955
{clEnqueueFillBuffer}.
1491514956
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
@@ -14978,6 +15019,7 @@ New errors:
1497815019
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1497915020
command-buffer.
1498015021
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
15022+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1498115023
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1498215024
--
1498315025

@@ -15008,6 +15050,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1500815050
_command_queue_ is `NULL`, then only one command-queue must have been set on
1500915051
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1501015052
endif::cl_khr_command_buffer_multi_device[]
15053+
* _properties_ specifies a list of properties for the command and their
15054+
corresponding values. Each property name is immediately followed by the
15055+
corresponding desired value. The list is terminated with 0. The
15056+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
15057+
supported properties may be defined by layered extensions in future.
1501115058
* _image_, _fill_color_, _origin_, _region_ refer to {clEnqueueFillImage}.
1501215059
* _sync_point_wait_list_, _num_sync_points_in_wait_list_ specify
1501315060
synchronization-points that need to complete before this particular
@@ -15075,6 +15122,7 @@ New errors:
1507515122
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1507615123
command-buffer.
1507715124
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
15125+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1507815126
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1507915127
--
1508015128

@@ -15110,7 +15158,7 @@ ifdef::cl_khr_command_buffer_mutable_dispatch[]
1511015158
The {cl_khr_command_buffer_EXT} extension does not define any
1511115159
properties, but supported properties defined by extensions are defined
1511215160
in the <<ndrange-kernel-properties-table, List of supported properties
15113-
by {clCommandNDRangeKernelKHR}>> table.
15161+
by clCommandNDRangeKernelKHR>> table.
1511415162
endif::cl_khr_command_buffer_mutable_dispatch[]
1511515163
* _kernel_ is a valid kernel object which **must** have its arguments set.
1511615164
Any changes to _kernel_ after calling {clCommandNDRangeKernelKHR}, such
@@ -15322,8 +15370,8 @@ New errors:
1532215370

1532315371
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1532415372
command-buffer.
15325-
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid
1532615373
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
15374+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1532715375
* {CL_INVALID_VALUE} if the {cl_khr_command_buffer_mutable_dispatch_EXT}
1532815376
extension is not supported and _mutable_handle_ is not `NULL`.
1532915377
* {CL_INVALID_OPERATION} if the device associated with _command_queue_
@@ -15372,6 +15420,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1537215420
_command_queue_ is `NULL`, then only one command-queue must have been set on
1537315421
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1537415422
endif::cl_khr_command_buffer_multi_device[]
15423+
* _properties_ specifies a list of properties for the command and thier
15424+
corresponding values. Each property name is immediately followed by the
15425+
corresponding desired value. The list is terminated with 0. The
15426+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
15427+
supported properties may be defined by layered extensions in future.
1537515428
* _dst_ptr_ is the pointer to a host (if the device supports system SVM)
1537615429
or SVM memory allocation where data is copied to.
1537715430
* _src_ptr_ is the pointer to a host (if the device supports system SVM)
@@ -15446,6 +15499,7 @@ New errors:
1544615499
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1544715500
command-buffer.
1544815501
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
15502+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1544915503
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1545015504
--
1545115505

@@ -15469,6 +15523,11 @@ ifdef::cl_khr_command_buffer_multi_device[]
1546915523
_command_queue_ is `NULL`, then only one command-queue must have been set on
1547015524
_command_buffer_ creation; otherwise, _command_queue_ must not be `NULL`.
1547115525
endif::cl_khr_command_buffer_multi_device[]
15526+
* _properties_ specifies a list of properties for the command and their
15527+
corresponding values. Each property name is immediately followed by the
15528+
corresponding desired value. The list is terminated with 0. The
15529+
{cl_khr_command_buffer_EXT} extension does not define any properties, but
15530+
supported properties may be defined by layered extensions in future.
1547215531
* _svm_ptr_ is a pointer to a (if the device supports system SVM)
1547315532
or SVM memory region that will be filled with _pattern_.
1547415533
It must be aligned to _pattern_size_ bytes.
@@ -15558,6 +15617,7 @@ New errors:
1555815617
* {CL_INVALID_COMMAND_BUFFER_KHR} if _command_buffer_ is not a valid
1555915618
command-buffer.
1556015619
* {CL_INVALID_OPERATION} if _command_buffer_ has been finalized.
15620+
* {CL_INVALID_VALUE} if values specified in _properties_ are not valid.
1556115621
* {CL_INVALID_VALUE} if _mutable_handle_ is not `NULL`.
1556215622
--
1556315623

config/rouge/lib/rouge/lexers/opencl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class OpenCL < Cpp
158158
cl_command_buffer_state_khr
159159
cl_command_buffer_properties_khr
160160
cl_command_buffer_flags_khr
161-
cl_ndrange_kernel_command_properties_khr
161+
cl_command_properties_khr
162162
cl_mutable_command_khr
163163
cl_mutable_dispatch_fields_khr
164164
cl_mutable_command_info_khr

0 commit comments

Comments
 (0)