@@ -15649,7 +15649,7 @@ endif::cl_khr_command_buffer_multi_device[]
1564915649
1565015650ifdef::cl_khr_command_buffer_mutable_dispatch[]
1565115651[[mutable-commands]]
15652- === Mutable Commands:
15652+ === Mutable Commands
1565315653
1565415654A generic {cl_mutable_command_khr_TYPE} handle is called a _mutable-command_
1565515655object 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}.
1566015660
1566115661Mutable-command handles are updated between enqueues using entry-point
1566215662{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.
1566815667Any modifications to the arguments or execution info of a mutable-dispatch
1566915668handle using {cl_mutable_dispatch_arg_khr_TYPE} or
1567015669{cl_mutable_dispatch_exec_info_khr_TYPE} have no affect on the original
@@ -15705,8 +15704,13 @@ include::{generated}/api/protos/clUpdateMutableCommandsKHR.txt[]
1570515704include::{generated}/api/version-notes/clUpdateMutableCommandsKHR.asciidoc[]
1570615705
1570715706 * _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.
1571015714
1571115715// refError
1571215716
@@ -15720,16 +15724,13 @@ one of the errors below is returned:
1572015724 * {CL_INVALID_OPERATION} if _command_buffer_ has not been finalized.
1572115725 * {CL_INVALID_OPERATION} if _command_buffer_ was not created with the
1572215726 {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.
1573315734 * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources
1573415735 required by the OpenCL implementation on the device.
1573515736 * {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
1575515756number when the ND-range command was recorded, the behavior is undefined.
1575615757====
1575715758
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:
1576615766
1576715767 * {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_.
1577115770 * {CL_INVALID_OPERATION} if the values of _local_work_size_ and/or
1577215771 _global_work_size_ result in a change to work-group uniformity.
1577315772 * {CL_INVALID_OPERATION} if the _work_dim_ is different from the
@@ -15795,24 +15794,25 @@ defined conditions:
1579515794 0, or _exec_info_list_ is not `NULL` and _num_exec_infos_ is 0.
1579615795--
1579715796
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
1580215799
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}.
1580415803
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
1581615816
1581715817[open,refpage='cl_mutable_dispatch_config_khr',desc='Set kernel configuration of a mutable clCommandNDRangeKernelKHR command',type='structs']
1581815818--
@@ -15822,9 +15822,6 @@ The {cl_mutable_dispatch_arg_khr_TYPE} structure is passed to
1582215822
1582315823include::{generated}/api/structs/cl_mutable_dispatch_config_khr.txt[]
1582415824
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.
1582815825 * _command_ is a mutable-command object returned by
1582915826 {clCommandNDRangeKernelKHR} representing a kernel execution as part of a
1583015827 command-buffer.
0 commit comments