Skip to content

Commit de317f9

Browse files
committed
Rename urCommandBufferEnqueueExp to urEnqueueCommandBufferExp
The API to enqueue a closed command-buffer to a queue is defined in the YAML as a part of the command-buffer class, but it should be part of the enqueue class like other enqueue API extensions. This PR updates the YAML and regenerates UR code, making the associated changes to adapters and CTS. Closes oneapi-src/unified-runtime#2600
1 parent e02ed86 commit de317f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+376
-376
lines changed

include/ur_api.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,6 @@ typedef enum ur_function_t {
417417
UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP = 240,
418418
/// Enumerator for ::urCommandBufferAppendUSMAdviseExp
419419
UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP = 241,
420-
/// Enumerator for ::urCommandBufferEnqueueExp
421-
UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP = 242,
422420
/// Enumerator for ::urCommandBufferUpdateSignalEventExp
423421
UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243,
424422
/// Enumerator for ::urCommandBufferUpdateWaitEventsExp
@@ -429,6 +427,8 @@ typedef enum ur_function_t {
429427
UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246,
430428
/// Enumerator for ::urPhysicalMemGetInfo
431429
UR_FUNCTION_PHYSICAL_MEM_GET_INFO = 249,
430+
/// Enumerator for ::urEnqueueCommandBufferExp
431+
UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP = 250,
432432
/// @cond
433433
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
434434
/// @endcond
@@ -7037,8 +7037,8 @@ typedef enum ur_command_t {
70377037
UR_COMMAND_READ_HOST_PIPE = 25,
70387038
/// Event created by ::urEnqueueWriteHostPipe
70397039
UR_COMMAND_WRITE_HOST_PIPE = 26,
7040-
/// Event created by ::urCommandBufferEnqueueExp
7041-
UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP = 0x1000,
7040+
/// Event created by ::urEnqueueCommandBufferExp
7041+
UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP = 0x1000,
70427042
/// Event created by ::urBindlessImagesWaitExternalSemaphoreExp
70437043
UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP = 0x2000,
70447044
/// Event created by ::urBindlessImagesSignalExternalSemaphoreExp
@@ -10994,8 +10994,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1099410994
/// - ::UR_RESULT_ERROR_DEVICE_LOST
1099510995
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
1099610996
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
10997-
/// + `NULL == hCommandBuffer`
1099810997
/// + `NULL == hQueue`
10998+
/// + `NULL == hCommandBuffer`
1099910999
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
1100011000
/// - ::UR_RESULT_ERROR_INVALID_QUEUE
1100111001
/// - ::UR_RESULT_ERROR_INVALID_EVENT
@@ -11005,11 +11005,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1100511005
/// + If event objects in phEventWaitList are not valid events.
1100611006
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
1100711007
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
11008-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
11009-
/// [in] Handle of the command-buffer object.
11010-
ur_exp_command_buffer_handle_t hCommandBuffer,
11008+
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCommandBufferExp(
1101111009
/// [in] The queue to submit this command-buffer for execution.
1101211010
ur_queue_handle_t hQueue,
11011+
/// [in] Handle of the command-buffer object.
11012+
ur_exp_command_buffer_handle_t hCommandBuffer,
1101311013
/// [in] Size of the event wait list.
1101411014
uint32_t numEventsInWaitList,
1101511015
/// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
@@ -13488,6 +13488,18 @@ typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
1348813488
ur_event_handle_t **pphEvent;
1348913489
} ur_enqueue_events_wait_with_barrier_ext_params_t;
1349013490

13491+
///////////////////////////////////////////////////////////////////////////////
13492+
/// @brief Function parameters for urEnqueueCommandBufferExp
13493+
/// @details Each entry is a pointer to the parameter passed to the function;
13494+
/// allowing the callback the ability to modify the parameter's value
13495+
typedef struct ur_enqueue_command_buffer_exp_params_t {
13496+
ur_queue_handle_t *phQueue;
13497+
ur_exp_command_buffer_handle_t *phCommandBuffer;
13498+
uint32_t *pnumEventsInWaitList;
13499+
const ur_event_handle_t **pphEventWaitList;
13500+
ur_event_handle_t **pphEvent;
13501+
} ur_enqueue_command_buffer_exp_params_t;
13502+
1349113503
///////////////////////////////////////////////////////////////////////////////
1349213504
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1349313505
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -14167,18 +14179,6 @@ typedef struct ur_command_buffer_append_usm_advise_exp_params_t {
1416714179
ur_exp_command_buffer_command_handle_t **pphCommand;
1416814180
} ur_command_buffer_append_usm_advise_exp_params_t;
1416914181

14170-
///////////////////////////////////////////////////////////////////////////////
14171-
/// @brief Function parameters for urCommandBufferEnqueueExp
14172-
/// @details Each entry is a pointer to the parameter passed to the function;
14173-
/// allowing the callback the ability to modify the parameter's value
14174-
typedef struct ur_command_buffer_enqueue_exp_params_t {
14175-
ur_exp_command_buffer_handle_t *phCommandBuffer;
14176-
ur_queue_handle_t *phQueue;
14177-
uint32_t *pnumEventsInWaitList;
14178-
const ur_event_handle_t **pphEventWaitList;
14179-
ur_event_handle_t **pphEvent;
14180-
} ur_command_buffer_enqueue_exp_params_t;
14181-
1418214182
///////////////////////////////////////////////////////////////////////////////
1418314183
/// @brief Function parameters for urCommandBufferUpdateKernelLaunchExp
1418414184
/// @details Each entry is a pointer to the parameter passed to the function;

include/ur_api_funcs.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ _UR_API(urEnqueueReadHostPipe)
132132
_UR_API(urEnqueueWriteHostPipe)
133133
_UR_API(urEnqueueEventsWaitWithBarrierExt)
134134
_UR_API(urEnqueueKernelLaunchCustomExp)
135+
_UR_API(urEnqueueCommandBufferExp)
135136
_UR_API(urEnqueueCooperativeKernelLaunchExp)
136137
_UR_API(urEnqueueTimestampRecordingExp)
137138
_UR_API(urEnqueueNativeCommandExp)
@@ -181,7 +182,6 @@ _UR_API(urCommandBufferAppendMemBufferReadRectExp)
181182
_UR_API(urCommandBufferAppendMemBufferFillExp)
182183
_UR_API(urCommandBufferAppendUSMPrefetchExp)
183184
_UR_API(urCommandBufferAppendUSMAdviseExp)
184-
_UR_API(urCommandBufferEnqueueExp)
185185
_UR_API(urCommandBufferUpdateKernelLaunchExp)
186186
_UR_API(urCommandBufferUpdateSignalEventExp)
187187
_UR_API(urCommandBufferUpdateWaitEventsExp)

include/ur_ddi.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,12 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueKernelLaunchCustomExp_t)(
11171117
const size_t *, const size_t *, uint32_t, const ur_exp_launch_property_t *,
11181118
uint32_t, const ur_event_handle_t *, ur_event_handle_t *);
11191119

1120+
///////////////////////////////////////////////////////////////////////////////
1121+
/// @brief Function-pointer for urEnqueueCommandBufferExp
1122+
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCommandBufferExp_t)(
1123+
ur_queue_handle_t, ur_exp_command_buffer_handle_t, uint32_t,
1124+
const ur_event_handle_t *, ur_event_handle_t *);
1125+
11201126
///////////////////////////////////////////////////////////////////////////////
11211127
/// @brief Function-pointer for urEnqueueCooperativeKernelLaunchExp
11221128
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCooperativeKernelLaunchExp_t)(
@@ -1142,6 +1148,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueNativeCommandExp_t)(
11421148
/// @brief Table of EnqueueExp functions pointers
11431149
typedef struct ur_enqueue_exp_dditable_t {
11441150
ur_pfnEnqueueKernelLaunchCustomExp_t pfnKernelLaunchCustomExp;
1151+
ur_pfnEnqueueCommandBufferExp_t pfnCommandBufferExp;
11451152
ur_pfnEnqueueCooperativeKernelLaunchExp_t pfnCooperativeKernelLaunchExp;
11461153
ur_pfnEnqueueTimestampRecordingExp_t pfnTimestampRecordingExp;
11471154
ur_pfnEnqueueNativeCommandExp_t pfnNativeCommandExp;
@@ -1590,12 +1597,6 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMAdviseExp_t)(
15901597
const ur_event_handle_t *, ur_exp_command_buffer_sync_point_t *,
15911598
ur_event_handle_t *, ur_exp_command_buffer_command_handle_t *);
15921599

1593-
///////////////////////////////////////////////////////////////////////////////
1594-
/// @brief Function-pointer for urCommandBufferEnqueueExp
1595-
typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferEnqueueExp_t)(
1596-
ur_exp_command_buffer_handle_t, ur_queue_handle_t, uint32_t,
1597-
const ur_event_handle_t *, ur_event_handle_t *);
1598-
15991600
///////////////////////////////////////////////////////////////////////////////
16001601
/// @brief Function-pointer for urCommandBufferUpdateKernelLaunchExp
16011602
typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferUpdateKernelLaunchExp_t)(
@@ -1639,7 +1640,6 @@ typedef struct ur_command_buffer_exp_dditable_t {
16391640
ur_pfnCommandBufferAppendMemBufferFillExp_t pfnAppendMemBufferFillExp;
16401641
ur_pfnCommandBufferAppendUSMPrefetchExp_t pfnAppendUSMPrefetchExp;
16411642
ur_pfnCommandBufferAppendUSMAdviseExp_t pfnAppendUSMAdviseExp;
1642-
ur_pfnCommandBufferEnqueueExp_t pfnEnqueueExp;
16431643
ur_pfnCommandBufferUpdateKernelLaunchExp_t pfnUpdateKernelLaunchExp;
16441644
ur_pfnCommandBufferUpdateSignalEventExp_t pfnUpdateSignalEventExp;
16451645
ur_pfnCommandBufferUpdateWaitEventsExp_t pfnUpdateWaitEventsExp;

include/ur_print.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,16 @@ urPrintEnqueueEventsWaitWithBarrierExtParams(
26262626
const struct ur_enqueue_events_wait_with_barrier_ext_params_t *params,
26272627
char *buffer, const size_t buff_size, size_t *out_size);
26282628

2629+
///////////////////////////////////////////////////////////////////////////////
2630+
/// @brief Print ur_enqueue_command_buffer_exp_params_t struct
2631+
/// @returns
2632+
/// - ::UR_RESULT_SUCCESS
2633+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2634+
/// - `buff_size < out_size`
2635+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueCommandBufferExpParams(
2636+
const struct ur_enqueue_command_buffer_exp_params_t *params, char *buffer,
2637+
const size_t buff_size, size_t *out_size);
2638+
26292639
///////////////////////////////////////////////////////////////////////////////
26302640
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
26312641
/// @returns
@@ -3161,16 +3171,6 @@ urPrintCommandBufferAppendUsmAdviseExpParams(
31613171
const struct ur_command_buffer_append_usm_advise_exp_params_t *params,
31623172
char *buffer, const size_t buff_size, size_t *out_size);
31633173

3164-
///////////////////////////////////////////////////////////////////////////////
3165-
/// @brief Print ur_command_buffer_enqueue_exp_params_t struct
3166-
/// @returns
3167-
/// - ::UR_RESULT_SUCCESS
3168-
/// - ::UR_RESULT_ERROR_INVALID_SIZE
3169-
/// - `buff_size < out_size`
3170-
UR_APIEXPORT ur_result_t UR_APICALL urPrintCommandBufferEnqueueExpParams(
3171-
const struct ur_command_buffer_enqueue_exp_params_t *params, char *buffer,
3172-
const size_t buff_size, size_t *out_size);
3173-
31743174
///////////////////////////////////////////////////////////////////////////////
31753175
/// @brief Print ur_command_buffer_update_kernel_launch_exp_params_t struct
31763176
/// @returns

include/ur_print.hpp

+55-55
Original file line numberDiff line numberDiff line change
@@ -1159,9 +1159,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) {
11591159
case UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP:
11601160
os << "UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP";
11611161
break;
1162-
case UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP:
1163-
os << "UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP";
1164-
break;
11651162
case UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP:
11661163
os << "UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP";
11671164
break;
@@ -1177,6 +1174,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) {
11771174
case UR_FUNCTION_PHYSICAL_MEM_GET_INFO:
11781175
os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO";
11791176
break;
1177+
case UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP:
1178+
os << "UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP";
1179+
break;
11801180
default:
11811181
os << "unknown enumerator";
11821182
break;
@@ -9882,8 +9882,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_command_t value) {
98829882
case UR_COMMAND_WRITE_HOST_PIPE:
98839883
os << "UR_COMMAND_WRITE_HOST_PIPE";
98849884
break;
9885-
case UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP:
9886-
os << "UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP";
9885+
case UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP:
9886+
os << "UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP";
98879887
break;
98889888
case UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP:
98899889
os << "UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP";
@@ -16188,6 +16188,53 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1618816188
return os;
1618916189
}
1619016190

16191+
///////////////////////////////////////////////////////////////////////////////
16192+
/// @brief Print operator for the ur_enqueue_command_buffer_exp_params_t type
16193+
/// @returns
16194+
/// std::ostream &
16195+
inline std::ostream &
16196+
operator<<(std::ostream &os,
16197+
[[maybe_unused]] const struct ur_enqueue_command_buffer_exp_params_t
16198+
*params) {
16199+
16200+
os << ".hQueue = ";
16201+
16202+
ur::details::printPtr(os, *(params->phQueue));
16203+
16204+
os << ", ";
16205+
os << ".hCommandBuffer = ";
16206+
16207+
ur::details::printPtr(os, *(params->phCommandBuffer));
16208+
16209+
os << ", ";
16210+
os << ".numEventsInWaitList = ";
16211+
16212+
os << *(params->pnumEventsInWaitList);
16213+
16214+
os << ", ";
16215+
os << ".phEventWaitList = ";
16216+
ur::details::printPtr(
16217+
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
16218+
if (*(params->pphEventWaitList) != NULL) {
16219+
os << " {";
16220+
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
16221+
if (i != 0) {
16222+
os << ", ";
16223+
}
16224+
16225+
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
16226+
}
16227+
os << "}";
16228+
}
16229+
16230+
os << ", ";
16231+
os << ".phEvent = ";
16232+
16233+
ur::details::printPtr(os, *(params->pphEvent));
16234+
16235+
return os;
16236+
}
16237+
1619116238
///////////////////////////////////////////////////////////////////////////////
1619216239
/// @brief Print operator for the
1619316240
/// ur_enqueue_cooperative_kernel_launch_exp_params_t type
@@ -18618,53 +18665,6 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1861818665
return os;
1861918666
}
1862018667

18621-
///////////////////////////////////////////////////////////////////////////////
18622-
/// @brief Print operator for the ur_command_buffer_enqueue_exp_params_t type
18623-
/// @returns
18624-
/// std::ostream &
18625-
inline std::ostream &
18626-
operator<<(std::ostream &os,
18627-
[[maybe_unused]] const struct ur_command_buffer_enqueue_exp_params_t
18628-
*params) {
18629-
18630-
os << ".hCommandBuffer = ";
18631-
18632-
ur::details::printPtr(os, *(params->phCommandBuffer));
18633-
18634-
os << ", ";
18635-
os << ".hQueue = ";
18636-
18637-
ur::details::printPtr(os, *(params->phQueue));
18638-
18639-
os << ", ";
18640-
os << ".numEventsInWaitList = ";
18641-
18642-
os << *(params->pnumEventsInWaitList);
18643-
18644-
os << ", ";
18645-
os << ".phEventWaitList = ";
18646-
ur::details::printPtr(
18647-
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
18648-
if (*(params->pphEventWaitList) != NULL) {
18649-
os << " {";
18650-
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
18651-
if (i != 0) {
18652-
os << ", ";
18653-
}
18654-
18655-
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
18656-
}
18657-
os << "}";
18658-
}
18659-
18660-
os << ", ";
18661-
os << ".phEvent = ";
18662-
18663-
ur::details::printPtr(os, *(params->pphEvent));
18664-
18665-
return os;
18666-
}
18667-
1866818668
///////////////////////////////////////////////////////////////////////////////
1866918669
/// @brief Print operator for the
1867018670
/// ur_command_buffer_update_kernel_launch_exp_params_t type
@@ -19873,6 +19873,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
1987319873
os << (const struct ur_enqueue_events_wait_with_barrier_ext_params_t *)
1987419874
params;
1987519875
} break;
19876+
case UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP: {
19877+
os << (const struct ur_enqueue_command_buffer_exp_params_t *)params;
19878+
} break;
1987619879
case UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP: {
1987719880
os << (const struct ur_enqueue_cooperative_kernel_launch_exp_params_t *)
1987819881
params;
@@ -20047,9 +20050,6 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
2004720050
os << (const struct ur_command_buffer_append_usm_advise_exp_params_t *)
2004820051
params;
2004920052
} break;
20050-
case UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP: {
20051-
os << (const struct ur_command_buffer_enqueue_exp_params_t *)params;
20052-
} break;
2005320053
case UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP: {
2005420054
os << (const struct ur_command_buffer_update_kernel_launch_exp_params_t *)
2005520055
params;

0 commit comments

Comments
 (0)