@@ -15647,7 +15647,7 @@ endif::cl_khr_command_buffer_multi_device[]
1564715647
1564815648ifdef::cl_khr_command_buffer_mutable_dispatch[]
1564915649[[mutable-commands]]
15650- === Mutable Commands:
15650+ === Mutable Commands
1565115651
1565215652A generic {cl_mutable_command_khr_TYPE} handle is called a _mutable-command_
1565315653object as it can be returned from any command recording entry-point in the
@@ -15658,11 +15658,10 @@ modified through the fields of {cl_mutable_dispatch_config_khr_TYPE}.
1565815658
1565915659Mutable-command handles are updated between enqueues using entry-point
1566015660{clUpdateMutableCommandsKHR}.
15661- To enable performant usage, all aspects of mutation are encapsulated inside
15662- a single {cl_mutable_base_config_khr_TYPE} parameter.
15663- This means that the runtime has access to all the information about how the
15664- command-buffer will change, allowing the command-buffer to be rebuilt as
15665- efficiently as possible.
15661+ To enable performant usage, all aspects of mutation can be passed in a single
15662+ call using an array. This means that the runtime has access to all the
15663+ information about how the command-buffer will change, allowing the
15664+ command-buffer to be rebuilt as efficiently as possible.
1566615665Any modifications to the arguments or execution info of a mutable-dispatch
1566715666handle using {cl_mutable_dispatch_arg_khr_TYPE} or
1566815667{cl_mutable_dispatch_exec_info_khr_TYPE} have no affect on the original
@@ -15703,8 +15702,13 @@ include::{generated}/api/protos/clUpdateMutableCommandsKHR.txt[]
1570315702include::{generated}/api/version-notes/clUpdateMutableCommandsKHR.asciidoc[]
1570415703
1570515704 * _command_buffer_ refers to a valid command-buffer object.
15706- * _mutable_config_ is a pointer to a {cl_mutable_base_config_khr_TYPE}
15707- structure defining updates to make to mutable-commands.
15705+ * _num_configs_ Number of elements in the _config_types_ and _config_ arrays.
15706+ * _config_types_ An array of length _num_configs_ with each element identifying
15707+ the type of each config in _configs_ at the same array index.
15708+ * _configs_ An array of length _num_configs_ containing structs which define how a
15709+ mutable-command handle in _command_buffer_ is to be updated, each of which is
15710+ interpreted using _config_types_ at the same index with the mapping defined
15711+ in the <<update-config-mapping, Mutable Command Update Structs>> section.
1570815712
1570915713// refError
1571015714
@@ -15718,16 +15722,13 @@ one of the errors below is returned:
1571815722 * {CL_INVALID_OPERATION} if _command_buffer_ has not been finalized.
1571915723 * {CL_INVALID_OPERATION} if _command_buffer_ was not created with the
1572015724 {CL_COMMAND_BUFFER_MUTABLE_KHR} flag.
15721- * {CL_INVALID_VALUE} if the _type_ member of _mutable_config_ is not
15722- {CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR}.
15723- * {CL_INVALID_VALUE} if the _mutable_dispatch_list_ member of
15724- _mutable_config_ is `NULL` and _num_mutable_dispatch_ > 0, or
15725- _mutable_dispatch_list_ is not `NULL` and _num_mutable_dispatch_ is 0.
15726- * {CL_INVALID_VALUE} if the _next_ member of _mutable_config_ is not
15727- `NULL` and any iteration of the structure pointer chain does not contain
15728- valid _type_ and _next_ members.
15729- * {CL_INVALID_VALUE} if _mutable_config_ is `NULL`, or if both _next_ and
15730- _mutable_dispatch_list_ members of _mutable_config_ are `NULL`.
15725+ * {CL_INVALID_VALUE} if _config_types_ is `NULL` and _num_configs_ > 0, or
15726+ _config_types_ is not `NULL` and _num_configs_ is 0.
15727+ * {CL_INVALID_VALUE} if _configs_ is `NULL` and _num_configs_ > 0, or
15728+ _configs_ is not `NULL` and _num_configs_ is 0.
15729+ * {CL_INVALID_VALUE} if any element of _config_types_ is not a valid
15730+ {cl_command_buffer_update_type_khr_TYPE} enum.
15731+ * {CL_INVALID_VALUE} if any element of _configs_ is NULL.
1573115732 * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources
1573215733 required by the OpenCL implementation on the device.
1573315734 * {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -15753,19 +15754,17 @@ parameters are updated so that the new number of work-groups exceeds the
1575315754number when the ND-range command was recorded, the behavior is undefined.
1575415755====
1575515756
15756- If the _mutable_dispatch_list_ member of _mutable_config_ is non-`NULL`,
15757- then errors defined by {clEnqueueNDRangeKernel}, {clSetKernelExecInfo},
15758- {clSetKernelArg}, and {clSetKernelArgSVMPointer} are returned by
15759- {clUpdateMutableCommandsKHR} if any of the array elements are set to an
15760- invalid value.
15761- Additionally, the following errors are returned if any
15762- {cl_mutable_dispatch_config_khr_TYPE} element of the array violates the
15763- defined conditions:
15757+ If _configs_ is non-`NULL`, then for any {cl_mutable_dispatch_config_khr_TYPE}
15758+ element of the array the errors defined by {clEnqueueNDRangeKernel},
15759+ {clSetKernelExecInfo}, {clSetKernelArg}, and {clSetKernelArgSVMPointer} are
15760+ returned by {clUpdateMutableCommandsKHR} if any of the struct elements are set
15761+ to an invalid value. Additionally, the following errors are returned if any
15762+ {cl_mutable_dispatch_config_khr_TYPE} element of the array violates the defined
15763+ conditions:
1576415764
1576515765 * {CL_INVALID_MUTABLE_COMMAND_KHR} if _command_ is not a valid mutable
15766- command object, or created from _command_buffer_.
15767- * {CL_INVALID_VALUE} if _type_ is not
15768- {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}.
15766+ command object returned from {clCommandNDRangeKernelKHR}, or created from
15767+ _command_buffer_.
1576915768 * {CL_INVALID_OPERATION} if the values of _local_work_size_ and/or
1577015769 _global_work_size_ result in a change to work-group uniformity.
1577115770 * {CL_INVALID_OPERATION} if the _work_dim_ is different from the
@@ -15793,24 +15792,25 @@ defined conditions:
1579315792 0, or _exec_info_list_ is not `NULL` and _num_exec_infos_ is 0.
1579415793--
1579515794
15796- [open,refpage='cl_mutable_base_config_khr',desc='DESC',type='structs']
15797- --
15798- The {cl_mutable_base_config_khr_TYPE} structure encapsulates all aspects of
15799- mutation and is defined as:
15795+ [[mutable-commands-update-structs]]
15796+ ==== Mutable Command Update Structs
1580015797
15801- include::{generated}/api/structs/cl_mutable_base_config_khr.txt[]
15798+ The following table defines the mapping of
15799+ {cl_command_buffer_update_type_khr_TYPE} values to the structs they define
15800+ reinterpreting a void pointer as when passed to {clUpdateMutableCommandsKHR}.
1580215801
15803- * _type_ is the type of this structure, and must be
15804- {CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR_anchor}
15805- * _next_ is `NULL` or a pointer to an extending structure.
15806- * _num_mutable_dispatch_ is the number of mutable-dispatch objects to
15807- configure in this enqueue of the command-buffer.
15808- * _mutable_dispatch_list_ is an array containing _num_mutable_dispatch_
15809- elements describing the configurations of mutable kernel execution
15810- commands in the command-buffer.
15811- For a description of struct members making up each array element see
15812- {cl_mutable_dispatch_config_khr_TYPE}.
15813- --
15802+ [[update-config-mapping]]
15803+ [cols=",,",options="header",]
15804+ |====
15805+ | Enum Value | Struct Type | Entry Point
15806+
15807+ | {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR_anchor}
15808+ | {cl_mutable_dispatch_config_khr_TYPE}
15809+ | {clCommandNDRangeKernelKHR}
15810+
15811+ |====
15812+
15813+ ==== Kernel Command Update Structs
1581415814
1581515815[open,refpage='cl_mutable_dispatch_config_khr',desc='Set kernel configuration of a mutable clCommandNDRangeKernelKHR command',type='structs']
1581615816--
@@ -15820,9 +15820,6 @@ The {cl_mutable_dispatch_arg_khr_TYPE} structure is passed to
1582015820
1582115821include::{generated}/api/structs/cl_mutable_dispatch_config_khr.txt[]
1582215822
15823- * _type_ is the type of this structure, and must be
15824- {CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR_anchor}.
15825- * _next_ is `NULL` or a pointer to an extending structure.
1582615823 * _command_ is a mutable-command object returned by
1582715824 {clCommandNDRangeKernelKHR} representing a kernel execution as part of a
1582815825 command-buffer.
0 commit comments