@@ -515,6 +515,8 @@ typedef enum ur_function_t {
515515 UR_FUNCTION_ENQUEUE_HOST_TASK_EXP = 309,
516516 /// Enumerator for ::urCommandBufferAppendKernelLaunchWithArgsExp
517517 UR_FUNCTION_COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_WITH_ARGS_EXP = 310,
518+ /// Enumerator for ::urKernelGetSuggestedLocalWorkSizeWithArgs
519+ UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE_WITH_ARGS = 311,
518520 /// @cond
519521 UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
520522 /// @endcond
@@ -9501,6 +9503,55 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize(
95019503 /// suggested local work size that will contain the result of the query
95029504 size_t *pSuggestedLocalWorkSize);
95039505
9506+ ///////////////////////////////////////////////////////////////////////////////
9507+ /// @brief Set kernel args and get the suggested local work size for a kernel.
9508+ ///
9509+ /// @details
9510+ /// - Query a suggested local work size for a kernel given a global size for
9511+ /// each dimension.
9512+ /// - The application may call this function from simultaneous threads for
9513+ /// the same context.
9514+ ///
9515+ /// @returns
9516+ /// - ::UR_RESULT_SUCCESS
9517+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
9518+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
9519+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
9520+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
9521+ /// + `NULL == hKernel`
9522+ /// + `NULL == hQueue`
9523+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
9524+ /// + `NULL == pGlobalWorkOffset`
9525+ /// + `NULL == pGlobalWorkSize`
9526+ /// + `NULL == pSuggestedLocalWorkSize`
9527+ /// + `pArgs == NULL && numArgs > 0`
9528+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
9529+ /// + `NULL != pArgs && ::UR_EXP_KERNEL_ARG_TYPE_SAMPLER < pArgs->type`
9530+ /// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
9531+ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSizeWithArgs(
9532+ /// [in] handle of the kernel
9533+ ur_kernel_handle_t hKernel,
9534+ /// [in] handle of the queue object
9535+ ur_queue_handle_t hQueue,
9536+ /// [in] number of dimensions, from 1 to 3, to specify the global
9537+ /// and work-group work-items
9538+ uint32_t numWorkDim,
9539+ /// [in] pointer to an array of numWorkDim unsigned values that specify
9540+ /// the offset used to calculate the global ID of a work-item
9541+ const size_t *pGlobalWorkOffset,
9542+ /// [in] pointer to an array of numWorkDim unsigned values that specify
9543+ /// the number of global work-items in workDim that will execute the
9544+ /// kernel function
9545+ const size_t *pGlobalWorkSize,
9546+ /// [in] Number of entries in pArgs
9547+ uint32_t numArgs,
9548+ /// [in][optional][range(0, numArgs)] pointer to a list of kernel arg
9549+ /// properties.
9550+ const ur_exp_kernel_arg_properties_t *pArgs,
9551+ /// [out] pointer to an array of numWorkDim unsigned values that specify
9552+ /// suggested local work size that will contain the result of the query
9553+ size_t *pSuggestedLocalWorkSize);
9554+
95049555///////////////////////////////////////////////////////////////////////////////
95059556/// @brief Query the maximum number of work groups for a cooperative kernel
95069557///
@@ -14581,6 +14632,21 @@ typedef struct ur_kernel_get_suggested_local_work_size_params_t {
1458114632 size_t **ppSuggestedLocalWorkSize;
1458214633} ur_kernel_get_suggested_local_work_size_params_t;
1458314634
14635+ ///////////////////////////////////////////////////////////////////////////////
14636+ /// @brief Function parameters for urKernelGetSuggestedLocalWorkSizeWithArgs
14637+ /// @details Each entry is a pointer to the parameter passed to the function;
14638+ /// allowing the callback the ability to modify the parameter's value
14639+ typedef struct ur_kernel_get_suggested_local_work_size_with_args_params_t {
14640+ ur_kernel_handle_t *phKernel;
14641+ ur_queue_handle_t *phQueue;
14642+ uint32_t *pnumWorkDim;
14643+ const size_t **ppGlobalWorkOffset;
14644+ const size_t **ppGlobalWorkSize;
14645+ uint32_t *pnumArgs;
14646+ const ur_exp_kernel_arg_properties_t **ppArgs;
14647+ size_t **ppSuggestedLocalWorkSize;
14648+ } ur_kernel_get_suggested_local_work_size_with_args_params_t;
14649+
1458414650///////////////////////////////////////////////////////////////////////////////
1458514651/// @brief Function parameters for urKernelSetArgValue
1458614652/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments