@@ -15649,7 +15649,7 @@ endif::cl_khr_command_buffer_multi_device[]
15649
15649
15650
15650
ifdef::cl_khr_command_buffer_mutable_dispatch[]
15651
15651
[[mutable-commands]]
15652
- === Mutable Commands:
15652
+ === Mutable Commands
15653
15653
15654
15654
A generic {cl_mutable_command_khr_TYPE} handle is called a _mutable-command_
15655
15655
object as it can be returned from any command recording entry-point in the
@@ -15660,11 +15660,10 @@ modified through the fields of {cl_mutable_dispatch_config_khr_TYPE}.
15660
15660
15661
15661
Mutable-command handles are updated between enqueues using entry-point
15662
15662
{clUpdateMutableCommandsKHR}.
15663
- To enable performant usage, all aspects of mutation are encapsulated inside
15664
- a single {cl_mutable_base_config_khr_TYPE} parameter.
15665
- This means that the runtime has access to all the information about how the
15666
- command-buffer will change, allowing the command-buffer to be rebuilt as
15667
- efficiently as possible.
15663
+ To enable performant usage, all aspects of mutation can be passed in a single
15664
+ call using an array. This means that the runtime has access to all the
15665
+ information about how the command-buffer will change, allowing the
15666
+ command-buffer to be rebuilt as efficiently as possible.
15668
15667
Any modifications to the arguments or execution info of a mutable-dispatch
15669
15668
handle using {cl_mutable_dispatch_arg_khr_TYPE} or
15670
15669
{cl_mutable_dispatch_exec_info_khr_TYPE} have no affect on the original
@@ -15705,8 +15704,13 @@ include::{generated}/api/protos/clUpdateMutableCommandsKHR.txt[]
15705
15704
include::{generated}/api/version-notes/clUpdateMutableCommandsKHR.asciidoc[]
15706
15705
15707
15706
* _command_buffer_ refers to a valid command-buffer object.
15708
- * _mutable_config_ is a pointer to a {cl_mutable_base_config_khr_TYPE}
15709
- structure defining updates to make to mutable-commands.
15707
+ * _num_configs_ Number of elements in the _config_types_ and _config_ arrays.
15708
+ * _config_types_ An array of length _num_configs_ with each element identifying
15709
+ the type of each config in _configs_ at the same array index.
15710
+ * _configs_ An array of length _num_configs_ containing structs which define how a
15711
+ mutable-command handle in _command_buffer_ is to be updated, each of which is
15712
+ interpreted using _config_types_ at the same index with the mapping defined
15713
+ in the <<update-config-mapping, Mutable Command Update Structs>> section.
15710
15714
15711
15715
// refError
15712
15716
@@ -15720,16 +15724,13 @@ one of the errors below is returned:
15720
15724
* {CL_INVALID_OPERATION} if _command_buffer_ has not been finalized.
15721
15725
* {CL_INVALID_OPERATION} if _command_buffer_ was not created with the
15722
15726
{CL_COMMAND_BUFFER_MUTABLE_KHR} flag.
15723
- * {CL_INVALID_VALUE} if the _type_ member of _mutable_config_ is not
15724
- {CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR}.
15725
- * {CL_INVALID_VALUE} if the _mutable_dispatch_list_ member of
15726
- _mutable_config_ is `NULL` and _num_mutable_dispatch_ > 0, or
15727
- _mutable_dispatch_list_ is not `NULL` and _num_mutable_dispatch_ is 0.
15728
- * {CL_INVALID_VALUE} if the _next_ member of _mutable_config_ is not
15729
- `NULL` and any iteration of the structure pointer chain does not contain
15730
- valid _type_ and _next_ members.
15731
- * {CL_INVALID_VALUE} if _mutable_config_ is `NULL`, or if both _next_ and
15732
- _mutable_dispatch_list_ members of _mutable_config_ are `NULL`.
15727
+ * {CL_INVALID_VALUE} if _config_types_ is `NULL` and _num_configs_ > 0, or
15728
+ _config_types_ is not `NULL` and _num_configs_ is 0.
15729
+ * {CL_INVALID_VALUE} if _configs_ is `NULL` and _num_configs_ > 0, or
15730
+ _configs_ is not `NULL` and _num_configs_ is 0.
15731
+ * {CL_INVALID_VALUE} if any element of _config_types_ is not a valid
15732
+ {cl_command_buffer_update_type_khr_TYPE} enum.
15733
+ * {CL_INVALID_VALUE} if any element of _configs_ is NULL.
15733
15734
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources
15734
15735
required by the OpenCL implementation on the device.
15735
15736
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -15755,19 +15756,17 @@ parameters are updated so that the new number of work-groups exceeds the
15755
15756
number when the ND-range command was recorded, the behavior is undefined.
15756
15757
====
15757
15758
15758
- If the _mutable_dispatch_list_ member of _mutable_config_ is non-`NULL`,
15759
- then errors defined by {clEnqueueNDRangeKernel}, {clSetKernelExecInfo},
15760
- {clSetKernelArg}, and {clSetKernelArgSVMPointer} are returned by
15761
- {clUpdateMutableCommandsKHR} if any of the array elements are set to an
15762
- invalid value.
15763
- Additionally, the following errors are returned if any
15764
- {cl_mutable_dispatch_config_khr_TYPE} element of the array violates the
15765
- defined conditions:
15759
+ If _configs_ is non-`NULL`, then for any {cl_mutable_dispatch_config_khr_TYPE}
15760
+ element of the array the errors defined by {clEnqueueNDRangeKernel},
15761
+ {clSetKernelExecInfo}, {clSetKernelArg}, and {clSetKernelArgSVMPointer} are
15762
+ returned by {clUpdateMutableCommandsKHR} if any of the struct elements are set
15763
+ to an invalid value. Additionally, the following errors are returned if any
15764
+ {cl_mutable_dispatch_config_khr_TYPE} element of the array violates the defined
15765
+ conditions:
15766
15766
15767
15767
* {CL_INVALID_MUTABLE_COMMAND_KHR} if _command_ is not a valid mutable
15768
- command object, or created from _command_buffer_.
15769
- * {CL_INVALID_VALUE} if _type_ is not
15770
- {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}.
15768
+ command object returned from {clCommandNDRangeKernelKHR}, or created from
15769
+ _command_buffer_.
15771
15770
* {CL_INVALID_OPERATION} if the values of _local_work_size_ and/or
15772
15771
_global_work_size_ result in a change to work-group uniformity.
15773
15772
* {CL_INVALID_OPERATION} if the _work_dim_ is different from the
@@ -15795,24 +15794,25 @@ defined conditions:
15795
15794
0, or _exec_info_list_ is not `NULL` and _num_exec_infos_ is 0.
15796
15795
--
15797
15796
15798
- [open,refpage='cl_mutable_base_config_khr',desc='DESC',type='structs']
15799
- --
15800
- The {cl_mutable_base_config_khr_TYPE} structure is TODO Add fuller
15801
- description here and is defined as:
15797
+ [[mutable-commands-update-structs]]
15798
+ ==== Mutable Command Update Structs
15802
15799
15803
- include::{generated}/api/structs/cl_mutable_base_config_khr.txt[]
15800
+ The following table defines the mapping of
15801
+ {cl_command_buffer_update_type_khr_TYPE} values to the structs they define
15802
+ reinterpreting a void pointer as when passed to {clUpdateMutableCommandsKHR}.
15804
15803
15805
- * _type_ is the type of this structure, and must be
15806
- {CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR}
15807
- * _next_ is `NULL` or a pointer to an extending structure.
15808
- * _num_mutable_dispatch_ is the number of mutable-dispatch objects to
15809
- configure in this enqueue of the command-buffer.
15810
- * _mutable_dispatch_list_ is an array containing _num_mutable_dispatch_
15811
- elements describing the configurations of mutable kernel execution
15812
- commands in the command-buffer.
15813
- For a description of struct members making up each array element see
15814
- {cl_mutable_dispatch_config_khr_TYPE}.
15815
- --
15804
+ [[update-config-mapping]]
15805
+ [cols=",,",options="header",]
15806
+ |====
15807
+ | Enum Value | Struct Type | Entry Point
15808
+
15809
+ | {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR_anchor}
15810
+ | {cl_mutable_dispatch_config_khr_TYPE}
15811
+ | {clCommandNDRangeKernelKHR}
15812
+
15813
+ |====
15814
+
15815
+ ==== Kernel Command Update Structs
15816
15816
15817
15817
[open,refpage='cl_mutable_dispatch_config_khr',desc='Set kernel configuration of a mutable clCommandNDRangeKernelKHR command',type='structs']
15818
15818
--
@@ -15822,9 +15822,6 @@ The {cl_mutable_dispatch_arg_khr_TYPE} structure is passed to
15822
15822
15823
15823
include::{generated}/api/structs/cl_mutable_dispatch_config_khr.txt[]
15824
15824
15825
- * _type_ is the type of this structure, and must be
15826
- {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}.
15827
- * _next_ is `NULL` or a pointer to an extending structure.
15828
15825
* _command_ is a mutable-command object returned by
15829
15826
{clCommandNDRangeKernelKHR} representing a kernel execution as part of a
15830
15827
command-buffer.
0 commit comments