C Specification
To modify the configuration of mutable-command handles returned during command_buffer recording, updating the behavior of those commands in future enqueues of command_buffer, call the function
// Provided by cl_khr_command_buffer_mutable_dispatch
cl_int clUpdateMutableCommandsKHR(
cl_command_buffer_khr command_buffer,
cl_uint num_configs,
const cl_command_buffer_update_type_khr* config_types,
const void** configs);
clUpdateMutableCommandsKHR is provided by the cl_khr_command_buffer_mutable_dispatch extension.
|
Parameters
-
command_buffer refers to a valid command-buffer object.
-
num_configs Number of elements in the config_types and config arrays.
-
config_types An array of length num_configs with each element identifying the type of each config in configs at the same array index.
-
configs An array of length num_configs containing structs which define how a mutable-command handle in command_buffer is to be updated, each of which is interpreted using config_types at the same index with the mapping defined in the Mutable Command Update Structs section.
Description
clUpdateMutableCommandsKHR returns CL_SUCCESS if all the mutable-command
objects were updated successfully.
Otherwise, none of the updates to mutable-command objects are preserved and
one of the errors below is returned:
-
CL_INVALID_if command_buffer is not a valid command-buffer.COMMAND_ BUFFER_ KHR -
CL_INVALID_if command_buffer has not been finalized.OPERATION -
CL_INVALID_if command_buffer was not created with theOPERATION CL_COMMAND_flag.BUFFER_ MUTABLE_ KHR -
CL_INVALID_if config_types isVALUE NULLand num_configs > 0, or config_types is notNULLand num_configs is 0. -
CL_INVALID_if configs isVALUE NULLand num_configs > 0, or configs is notNULLand num_configs is 0. -
CL_INVALID_if any element of config_types is not a validVALUE cl_command_enum.buffer_ update_ type_ khr -
CL_INVALID_if any element of configs is NULL.VALUE -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Using this function when command_buffer is in the pending
state and not created with the CL_COMMAND_ flag
causes undefined behavior.
|
Performant usage is to call clUpdateMutableCommandsKHR only when the desired state of all commands is known, rather than iteratively updating each command individually. |
|
If the command buffer has been created with
|
If configs is non-NULL, then for any cl_mutable_
element of the array the errors defined by clEnqueueNDRangeKernel,
clSetKernelExecInfo, clSetKernelArg, and clSetKernelArgSVMPointer are
returned by clUpdateMutableCommandsKHR if any of the struct elements are set
to an invalid value. Additionally, the following errors are returned if any
cl_mutable_ element of the array violates the defined
conditions:
-
CL_INVALID_if command is not a valid mutable command object returned from clCommandNDRangeKernelKHR, or created from command_buffer.MUTABLE_ COMMAND_ KHR -
CL_INVALID_if the values of local_work_size and/or global_work_size result in a change to work-group uniformity.OPERATION -
CL_INVALID_if work_dim is not zero and different from the work_dim set on command recording.OPERATION -
CL_INVALID_if theOPERATION CL_MUTABLE_property was not set on command recording and global_work_offset is notDISPATCH_ GLOBAL_ OFFSET_ KHR NULL. -
CL_INVALID_if theOPERATION CL_MUTABLE_property was not set on command recording and global_work_size is notDISPATCH_ GLOBAL_ SIZE_ KHR NULL. -
CL_INVALID_if theOPERATION CL_MUTABLE_property was not set on command recording and local_work_size is notDISPATCH_ LOCAL_ SIZE_ KHR NULL. -
CL_INVALID_if theOPERATION CL_MUTABLE_property was not set on command recording and num_args or num_svm_args is non-zero.DISPATCH_ ARGUMENTS_ KHR -
CL_INVALID_if theOPERATION CL_MUTABLE_property was not set on command recording and num_exec_infos is non-zero.DISPATCH_ EXEC_ INFO_ KHR -
CL_INVALID_if arg_list isVALUE NULLand num_args > 0, or arg_list is notNULLand num_args is 0. -
CL_INVALID_if arg_svm_list isVALUE NULLand num_svm_args > 0, or arg_svm_list is notNULLand num_svm_args is 0. -
CL_INVALID_if exec_info_list isVALUE NULLand num_exec_infos > 0, or exec_info_list is notNULLand num_exec_infos is 0.
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.