@@ -9969,6 +9969,21 @@ typedef struct ur_exp_command_buffer_desc_t {
99699969
99709970} ur_exp_command_buffer_desc_t;
99719971
9972+ ///////////////////////////////////////////////////////////////////////////////
9973+ /// @brief A value that identifies a command inside of a command-buffer, used
9974+ /// for
9975+ /// defining dependencies between commands in the same command-buffer.
9976+ typedef uint32_t ur_exp_command_buffer_sync_point_t;
9977+
9978+ ///////////////////////////////////////////////////////////////////////////////
9979+ /// @brief Handle of Command-Buffer object
9980+ typedef struct ur_exp_command_buffer_handle_t_ *ur_exp_command_buffer_handle_t;
9981+
9982+ ///////////////////////////////////////////////////////////////////////////////
9983+ /// @brief Handle of a Command-Buffer command
9984+ typedef struct ur_exp_command_buffer_command_handle_t_
9985+ *ur_exp_command_buffer_command_handle_t;
9986+
99729987///////////////////////////////////////////////////////////////////////////////
99739988/// @brief Descriptor type for updating a kernel command memobj argument.
99749989typedef struct ur_exp_command_buffer_update_memobj_arg_desc_t {
@@ -10032,6 +10047,8 @@ typedef struct ur_exp_command_buffer_update_kernel_launch_desc_t {
1003210047 ur_structure_type_t stype;
1003310048 /// [in][optional] pointer to extension-specific structure
1003410049 const void *pNext;
10050+ /// [in] Handle of the command-buffer kernel command to update.
10051+ ur_exp_command_buffer_command_handle_t hCommand;
1003510052 /// [in][optional] The new kernel handle. If this parameter is nullptr,
1003610053 /// the current kernel handle in `hCommand`
1003710054 /// will be used. If a kernel handle is passed, it must be a valid kernel
@@ -10081,21 +10098,6 @@ typedef struct ur_exp_command_buffer_update_kernel_launch_desc_t {
1008110098
1008210099} ur_exp_command_buffer_update_kernel_launch_desc_t;
1008310100
10084- ///////////////////////////////////////////////////////////////////////////////
10085- /// @brief A value that identifies a command inside of a command-buffer, used
10086- /// for
10087- /// defining dependencies between commands in the same command-buffer.
10088- typedef uint32_t ur_exp_command_buffer_sync_point_t;
10089-
10090- ///////////////////////////////////////////////////////////////////////////////
10091- /// @brief Handle of Command-Buffer object
10092- typedef struct ur_exp_command_buffer_handle_t_ *ur_exp_command_buffer_handle_t;
10093-
10094- ///////////////////////////////////////////////////////////////////////////////
10095- /// @brief Handle of a Command-Buffer command
10096- typedef struct ur_exp_command_buffer_command_handle_t_
10097- *ur_exp_command_buffer_command_handle_t;
10098-
1009910101///////////////////////////////////////////////////////////////////////////////
1010010102/// @brief Create a Command-Buffer object
1010110103///
@@ -11042,74 +11044,84 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
1104211044///
1104311045/// @details
1104411046/// This entry-point is synchronous and may block if the command-buffer is
11045- /// executing when the entry-point is called.
11047+ /// executing when the entry-point is called. On error, none of the updates to
11048+ /// mutable-command objects are preserved.
1104611049///
1104711050/// @returns
1104811051/// - ::UR_RESULT_SUCCESS
1104911052/// - ::UR_RESULT_ERROR_UNINITIALIZED
1105011053/// - ::UR_RESULT_ERROR_DEVICE_LOST
1105111054/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
1105211055/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
11053- /// + `NULL == hCommand`
11056+ /// + `NULL == hCommandBuffer`
11057+ /// + `NULL == pUpdateKernelLaunch->hCommand`
1105411058/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
1105511059/// + `NULL == pUpdateKernelLaunch`
11060+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
11061+ /// - ::UR_RESULT_ERROR_INVALID_SIZE
11062+ /// + `numKernelUpdates == 0`
1105611063/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
1105711064/// + If
1105811065/// ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_KERNEL_ARGUMENTS
11059- /// is not supported by the device, but any of
11060- /// `pUpdateKernelLaunch->numNewMemObjArgs`,
11061- /// `pUpdateKernelLaunch->numNewPointerArgs`, or
11062- /// `pUpdateKernelLaunch->numNewValueArgs` are not zero.
11066+ /// is not supported by the device, and for any of any element of
11067+ /// `pUpdateKernelLaunch` the `numNewMemObjArgs`, `numNewPointerArgs`,
11068+ /// or `numNewValueArgs` members are not zero.
1106311069/// + If
1106411070/// ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_LOCAL_WORK_SIZE is
11065- /// not supported by the device but
11066- /// `pUpdateKernelLaunch-> pNewLocalWorkSize` is not nullptr.
11071+ /// not supported by the device, and for any element of
11072+ /// `pUpdateKernelLaunch` the ` pNewLocalWorkSize` member is not nullptr.
1106711073/// + If
1106811074/// ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_LOCAL_WORK_SIZE is
11069- /// not supported by the device but
11070- /// `pUpdateKernelLaunch-> pNewLocalWorkSize` is nullptr and
11071- /// `pUpdateKernelLaunch-> pNewGlobalWorkSize` is not nullptr.
11075+ /// not supported by the device, and for any element of
11076+ /// `pUpdateKernelLaunch` the ` pNewLocalWorkSize` member is nullptr and
11077+ /// `pNewGlobalWorkSize` is not nullptr.
1107211078/// + If
1107311079/// ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_GLOBAL_WORK_SIZE
11074- /// is not supported by the device but
11075- /// `pUpdateKernelLaunch-> pNewGlobalWorkSize` is not nullptr
11080+ /// is not supported by the device, and for any element of
11081+ /// `pUpdateKernelLaunch` the ` pNewGlobalWorkSize` member is not nullptr
1107611082/// + If
1107711083/// ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_GLOBAL_WORK_OFFSET
11078- /// is not supported by the device but
11079- /// `pUpdateKernelLaunch->pNewGlobalWorkOffset` is not nullptr.
11084+ /// is not supported by the device, and for any element of
11085+ /// `pUpdateKernelLaunch` the `pNewGlobalWorkOffset` member is not
11086+ /// nullptr.
1108011087/// + If ::UR_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_KERNEL_HANDLE
11081- /// is not supported by the device but `pUpdateKernelLaunch->hNewKernel`
11082- /// is not nullptr.
11088+ /// is not supported by the device, and for any element of
11089+ /// `pUpdateKernelLaunch` the `hNewKernel` member is not nullptr.
1108311090/// - ::UR_RESULT_ERROR_INVALID_OPERATION
1108411091/// + If ::ur_exp_command_buffer_desc_t::isUpdatable was not set to true
11085- /// on creation of the command-buffer `hCommand` belongs to.
11086- /// + If the command-buffer `hCommand` belongs to has not been
11087- /// finalized.
11092+ /// on creation of the `hCommandBuffer`.
11093+ /// + If `hCommandBuffer` has not been finalized.
1108811094/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_COMMAND_HANDLE_EXP
11089- /// + If `hCommand` is not a kernel execution command.
11095+ /// + If for any element of `pUpdateKernelLaunch` the `hCommand` member
11096+ /// is not a kernel execution command.
11097+ /// + If for any element of `pUpdateKernelLaunch` the `hCommand` member
11098+ /// was not created from `hCommandBuffer`.
1109011099/// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT
1109111100/// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX
1109211101/// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE
1109311102/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1109411103/// - ::UR_RESULT_ERROR_INVALID_WORK_DIMENSION
11095- /// + `pUpdateKernelLaunch->newWorkDim < 1 ||
11096- /// pUpdateKernelLaunch->newWorkDim > 3`
11104+ /// + If for any element of `pUpdateKernelLaunch` the `newWorkDim`
11105+ /// member is less than 1 or greater than 3.
1109711106/// - ::UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE
1109811107/// - ::UR_RESULT_ERROR_INVALID_VALUE
11099- /// + If `pUpdateKernelLaunch->hNewKernel` was not passed to the
11100- /// `hKernel` or `phKernelAlternatives` parameters of
11101- /// ::urCommandBufferAppendKernelLaunchExp when this command was
11102- /// created.
11103- /// + If `pUpdateKernelLaunch->newWorkDim` is different from the current
11104- /// workDim in `hCommand` and,
11105- /// `pUpdateKernelLaunch-> pNewGlobalWorkSize`, or
11106- /// `pUpdateKernelLaunch->pNewGlobalWorkOffset` are nullptr.
11108+ /// + If for any element of `pUpdateKernelLaunch` the `hNewKernel`
11109+ /// member was not passed to the `hKernel` or `phKernelAlternatives`
11110+ /// parameters of ::urCommandBufferAppendKernelLaunchExp when the
11111+ /// command was created.
11112+ /// + If for any element of `pUpdateKernelLaunch` the `newWorkDim`
11113+ /// member is different from the current workDim in the `hCommand`
11114+ /// member, and ` pNewGlobalWorkSize` or `pNewGlobalWorkOffset` are
11115+ /// nullptr.
1110711116/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
1110811117/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
1110911118UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
11110- /// [in] Handle of the command-buffer kernel command to update.
11111- ur_exp_command_buffer_command_handle_t hCommand,
11112- /// [in] Struct defining how the kernel command is to be updated.
11119+ /// [in] Handle of the command-buffer object.
11120+ ur_exp_command_buffer_handle_t hCommandBuffer,
11121+ /// [in] Length of pUpdateKernelLaunch.
11122+ uint32_t numKernelUpdates,
11123+ /// [in][range(0, numKernelUpdates)] List of structs defining how a
11124+ /// kernel commands are to be updated.
1111311125 const ur_exp_command_buffer_update_kernel_launch_desc_t
1111411126 *pUpdateKernelLaunch);
1111511127
@@ -14200,7 +14212,8 @@ typedef struct ur_command_buffer_enqueue_exp_params_t {
1420014212/// @details Each entry is a pointer to the parameter passed to the function;
1420114213/// allowing the callback the ability to modify the parameter's value
1420214214typedef struct ur_command_buffer_update_kernel_launch_exp_params_t {
14203- ur_exp_command_buffer_command_handle_t *phCommand;
14215+ ur_exp_command_buffer_handle_t *phCommandBuffer;
14216+ uint32_t *pnumKernelUpdates;
1420414217 const ur_exp_command_buffer_update_kernel_launch_desc_t *
1420514218 *ppUpdateKernelLaunch;
1420614219} ur_command_buffer_update_kernel_launch_exp_params_t;
0 commit comments