Skip to content

Commit 4271718

Browse files
committed
[SYCL][Graph][UR] Rename cmd-buf enqueue entry-point
**Same PR as was closed in intel#16747 due to intel#16982 Reflects change in name of UR entry-point from `urCommandBufferEnqueueExp` to `urEnqueueCommandBufferExp` in oneapi-src/unified-runtime#2606
1 parent ed8b38e commit 4271718

Some content is hidden

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

53 files changed

+381
-381
lines changed

sycl/source/detail/graph_impl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,8 @@ exec_graph_impl::enqueue(const std::shared_ptr<sycl::detail::queue_impl> &Queue,
10541054
ur_result_t Res =
10551055
Queue->getAdapter()
10561056
->call_nocheck<
1057-
sycl::detail::UrApiKind::urCommandBufferEnqueueExp>(
1058-
CommandBuffer, Queue->getHandleRef(), 0, nullptr, &UREvent);
1057+
sycl::detail::UrApiKind::urEnqueueCommandBufferExp>(
1058+
Queue->getHandleRef(), CommandBuffer, 0, nullptr, &UREvent);
10591059
NewEvent->setHandle(UREvent);
10601060
if (Res == UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES) {
10611061
throw sycl::exception(

sycl/source/detail/scheduler/commands.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3601,8 +3601,8 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
36013601
MEvent->setHostEnqueueTime();
36023602
if (auto Result =
36033603
MQueue->getAdapter()
3604-
->call_nocheck<UrApiKind::urCommandBufferEnqueueExp>(
3605-
CmdBufferCG->MCommandBuffer, MQueue->getHandleRef(),
3604+
->call_nocheck<UrApiKind::urEnqueueCommandBufferExp>(
3605+
MQueue->getHandleRef(), CmdBufferCG->MCommandBuffer,
36063606
RawEvents.size(),
36073607
RawEvents.empty() ? nullptr : &RawEvents[0], Event);
36083608
Result != UR_RESULT_SUCCESS)

unified-runtime/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
@@ -7045,8 +7045,8 @@ typedef enum ur_command_t {
70457045
UR_COMMAND_READ_HOST_PIPE = 25,
70467046
/// Event created by ::urEnqueueWriteHostPipe
70477047
UR_COMMAND_WRITE_HOST_PIPE = 26,
7048-
/// Event created by ::urCommandBufferEnqueueExp
7049-
UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP = 0x1000,
7048+
/// Event created by ::urEnqueueCommandBufferExp
7049+
UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP = 0x1000,
70507050
/// Event created by ::urBindlessImagesWaitExternalSemaphoreExp
70517051
UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP = 0x2000,
70527052
/// Event created by ::urBindlessImagesSignalExternalSemaphoreExp
@@ -11011,8 +11011,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1101111011
/// - ::UR_RESULT_ERROR_DEVICE_LOST
1101211012
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
1101311013
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
11014-
/// + `NULL == hCommandBuffer`
1101511014
/// + `NULL == hQueue`
11015+
/// + `NULL == hCommandBuffer`
1101611016
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
1101711017
/// - ::UR_RESULT_ERROR_INVALID_QUEUE
1101811018
/// - ::UR_RESULT_ERROR_INVALID_EVENT
@@ -11022,11 +11022,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1102211022
/// + If event objects in phEventWaitList are not valid events.
1102311023
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
1102411024
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
11025-
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
11026-
/// [in] Handle of the command-buffer object.
11027-
ur_exp_command_buffer_handle_t hCommandBuffer,
11025+
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCommandBufferExp(
1102811026
/// [in] The queue to submit this command-buffer for execution.
1102911027
ur_queue_handle_t hQueue,
11028+
/// [in] Handle of the command-buffer object.
11029+
ur_exp_command_buffer_handle_t hCommandBuffer,
1103011030
/// [in] Size of the event wait list.
1103111031
uint32_t numEventsInWaitList,
1103211032
/// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
@@ -13507,6 +13507,18 @@ typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
1350713507
ur_event_handle_t **pphEvent;
1350813508
} ur_enqueue_events_wait_with_barrier_ext_params_t;
1350913509

13510+
///////////////////////////////////////////////////////////////////////////////
13511+
/// @brief Function parameters for urEnqueueCommandBufferExp
13512+
/// @details Each entry is a pointer to the parameter passed to the function;
13513+
/// allowing the callback the ability to modify the parameter's value
13514+
typedef struct ur_enqueue_command_buffer_exp_params_t {
13515+
ur_queue_handle_t *phQueue;
13516+
ur_exp_command_buffer_handle_t *phCommandBuffer;
13517+
uint32_t *pnumEventsInWaitList;
13518+
const ur_event_handle_t **pphEventWaitList;
13519+
ur_event_handle_t **pphEvent;
13520+
} ur_enqueue_command_buffer_exp_params_t;
13521+
1351013522
///////////////////////////////////////////////////////////////////////////////
1351113523
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1351213524
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -14186,18 +14198,6 @@ typedef struct ur_command_buffer_append_usm_advise_exp_params_t {
1418614198
ur_exp_command_buffer_command_handle_t **pphCommand;
1418714199
} ur_command_buffer_append_usm_advise_exp_params_t;
1418814200

14189-
///////////////////////////////////////////////////////////////////////////////
14190-
/// @brief Function parameters for urCommandBufferEnqueueExp
14191-
/// @details Each entry is a pointer to the parameter passed to the function;
14192-
/// allowing the callback the ability to modify the parameter's value
14193-
typedef struct ur_command_buffer_enqueue_exp_params_t {
14194-
ur_exp_command_buffer_handle_t *phCommandBuffer;
14195-
ur_queue_handle_t *phQueue;
14196-
uint32_t *pnumEventsInWaitList;
14197-
const ur_event_handle_t **pphEventWaitList;
14198-
ur_event_handle_t **pphEvent;
14199-
} ur_command_buffer_enqueue_exp_params_t;
14200-
1420114201
///////////////////////////////////////////////////////////////////////////////
1420214202
/// @brief Function parameters for urCommandBufferUpdateKernelLaunchExp
1420314203
/// @details Each entry is a pointer to the parameter passed to the function;

unified-runtime/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)

unified-runtime/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;

unified-runtime/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

unified-runtime/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;
@@ -9899,8 +9899,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_command_t value) {
98999899
case UR_COMMAND_WRITE_HOST_PIPE:
99009900
os << "UR_COMMAND_WRITE_HOST_PIPE";
99019901
break;
9902-
case UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP:
9903-
os << "UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP";
9902+
case UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP:
9903+
os << "UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP";
99049904
break;
99059905
case UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP:
99069906
os << "UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP";
@@ -16205,6 +16205,53 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1620516205
return os;
1620616206
}
1620716207

16208+
///////////////////////////////////////////////////////////////////////////////
16209+
/// @brief Print operator for the ur_enqueue_command_buffer_exp_params_t type
16210+
/// @returns
16211+
/// std::ostream &
16212+
inline std::ostream &
16213+
operator<<(std::ostream &os,
16214+
[[maybe_unused]] const struct ur_enqueue_command_buffer_exp_params_t
16215+
*params) {
16216+
16217+
os << ".hQueue = ";
16218+
16219+
ur::details::printPtr(os, *(params->phQueue));
16220+
16221+
os << ", ";
16222+
os << ".hCommandBuffer = ";
16223+
16224+
ur::details::printPtr(os, *(params->phCommandBuffer));
16225+
16226+
os << ", ";
16227+
os << ".numEventsInWaitList = ";
16228+
16229+
os << *(params->pnumEventsInWaitList);
16230+
16231+
os << ", ";
16232+
os << ".phEventWaitList = ";
16233+
ur::details::printPtr(
16234+
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
16235+
if (*(params->pphEventWaitList) != NULL) {
16236+
os << " {";
16237+
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
16238+
if (i != 0) {
16239+
os << ", ";
16240+
}
16241+
16242+
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
16243+
}
16244+
os << "}";
16245+
}
16246+
16247+
os << ", ";
16248+
os << ".phEvent = ";
16249+
16250+
ur::details::printPtr(os, *(params->pphEvent));
16251+
16252+
return os;
16253+
}
16254+
1620816255
///////////////////////////////////////////////////////////////////////////////
1620916256
/// @brief Print operator for the
1621016257
/// ur_enqueue_cooperative_kernel_launch_exp_params_t type
@@ -18635,53 +18682,6 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1863518682
return os;
1863618683
}
1863718684

18638-
///////////////////////////////////////////////////////////////////////////////
18639-
/// @brief Print operator for the ur_command_buffer_enqueue_exp_params_t type
18640-
/// @returns
18641-
/// std::ostream &
18642-
inline std::ostream &
18643-
operator<<(std::ostream &os,
18644-
[[maybe_unused]] const struct ur_command_buffer_enqueue_exp_params_t
18645-
*params) {
18646-
18647-
os << ".hCommandBuffer = ";
18648-
18649-
ur::details::printPtr(os, *(params->phCommandBuffer));
18650-
18651-
os << ", ";
18652-
os << ".hQueue = ";
18653-
18654-
ur::details::printPtr(os, *(params->phQueue));
18655-
18656-
os << ", ";
18657-
os << ".numEventsInWaitList = ";
18658-
18659-
os << *(params->pnumEventsInWaitList);
18660-
18661-
os << ", ";
18662-
os << ".phEventWaitList = ";
18663-
ur::details::printPtr(
18664-
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
18665-
if (*(params->pphEventWaitList) != NULL) {
18666-
os << " {";
18667-
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
18668-
if (i != 0) {
18669-
os << ", ";
18670-
}
18671-
18672-
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
18673-
}
18674-
os << "}";
18675-
}
18676-
18677-
os << ", ";
18678-
os << ".phEvent = ";
18679-
18680-
ur::details::printPtr(os, *(params->pphEvent));
18681-
18682-
return os;
18683-
}
18684-
1868518685
///////////////////////////////////////////////////////////////////////////////
1868618686
/// @brief Print operator for the
1868718687
/// ur_command_buffer_update_kernel_launch_exp_params_t type
@@ -19890,6 +19890,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
1989019890
os << (const struct ur_enqueue_events_wait_with_barrier_ext_params_t *)
1989119891
params;
1989219892
} break;
19893+
case UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP: {
19894+
os << (const struct ur_enqueue_command_buffer_exp_params_t *)params;
19895+
} break;
1989319896
case UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP: {
1989419897
os << (const struct ur_enqueue_cooperative_kernel_launch_exp_params_t *)
1989519898
params;
@@ -20064,9 +20067,6 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
2006420067
os << (const struct ur_command_buffer_append_usm_advise_exp_params_t *)
2006520068
params;
2006620069
} break;
20067-
case UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP: {
20068-
os << (const struct ur_command_buffer_enqueue_exp_params_t *)params;
20069-
} break;
2007020070
case UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP: {
2007120071
os << (const struct ur_command_buffer_update_kernel_launch_exp_params_t *)
2007220072
params;

0 commit comments

Comments
 (0)