Skip to content

Commit 6789663

Browse files
committed
Revert "Merge pull request #2606 from Bensuo/cmd-buf_enqueue_refactor"
This reverts commit cc60d08, from oneapi-src/unified-runtime#2606 due to CI fails in the DPC++ bump PR that need further investigation #16747
1 parent 7e8d04e commit 6789663

Some content is hidden

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

50 files changed

+365
-376
lines changed

include/ur_api.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ 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,
420422
/// Enumerator for ::urCommandBufferUpdateSignalEventExp
421423
UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243,
422424
/// Enumerator for ::urCommandBufferUpdateWaitEventsExp
@@ -427,8 +429,6 @@ typedef enum ur_function_t {
427429
UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246,
428430
/// Enumerator for ::urPhysicalMemGetInfo
429431
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
@@ -7044,8 +7044,8 @@ typedef enum ur_command_t {
70447044
UR_COMMAND_READ_HOST_PIPE = 25,
70457045
/// Event created by ::urEnqueueWriteHostPipe
70467046
UR_COMMAND_WRITE_HOST_PIPE = 26,
7047-
/// Event created by ::urEnqueueCommandBufferExp
7048-
UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP = 0x1000,
7047+
/// Event created by ::urCommandBufferEnqueueExp
7048+
UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP = 0x1000,
70497049
/// Event created by ::urBindlessImagesWaitExternalSemaphoreExp
70507050
UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP = 0x2000,
70517051
/// Event created by ::urBindlessImagesSignalExternalSemaphoreExp
@@ -11001,8 +11001,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1100111001
/// - ::UR_RESULT_ERROR_DEVICE_LOST
1100211002
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
1100311003
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
11004-
/// + `NULL == hQueue`
1100511004
/// + `NULL == hCommandBuffer`
11005+
/// + `NULL == hQueue`
1100611006
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
1100711007
/// - ::UR_RESULT_ERROR_INVALID_QUEUE
1100811008
/// - ::UR_RESULT_ERROR_INVALID_EVENT
@@ -11012,11 +11012,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp(
1101211012
/// + If event objects in phEventWaitList are not valid events.
1101311013
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
1101411014
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
11015-
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueCommandBufferExp(
11016-
/// [in] The queue to submit this command-buffer for execution.
11017-
ur_queue_handle_t hQueue,
11015+
UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
1101811016
/// [in] Handle of the command-buffer object.
1101911017
ur_exp_command_buffer_handle_t hCommandBuffer,
11018+
/// [in] The queue to submit this command-buffer for execution.
11019+
ur_queue_handle_t hQueue,
1102011020
/// [in] Size of the event wait list.
1102111021
uint32_t numEventsInWaitList,
1102211022
/// [in][optional][range(0, numEventsInWaitList)] pointer to a list of
@@ -13495,18 +13495,6 @@ typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
1349513495
ur_event_handle_t **pphEvent;
1349613496
} ur_enqueue_events_wait_with_barrier_ext_params_t;
1349713497

13498-
///////////////////////////////////////////////////////////////////////////////
13499-
/// @brief Function parameters for urEnqueueCommandBufferExp
13500-
/// @details Each entry is a pointer to the parameter passed to the function;
13501-
/// allowing the callback the ability to modify the parameter's value
13502-
typedef struct ur_enqueue_command_buffer_exp_params_t {
13503-
ur_queue_handle_t *phQueue;
13504-
ur_exp_command_buffer_handle_t *phCommandBuffer;
13505-
uint32_t *pnumEventsInWaitList;
13506-
const ur_event_handle_t **pphEventWaitList;
13507-
ur_event_handle_t **pphEvent;
13508-
} ur_enqueue_command_buffer_exp_params_t;
13509-
1351013498
///////////////////////////////////////////////////////////////////////////////
1351113499
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1351213500
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -14186,6 +14174,18 @@ typedef struct ur_command_buffer_append_usm_advise_exp_params_t {
1418614174
ur_exp_command_buffer_command_handle_t **pphCommand;
1418714175
} ur_command_buffer_append_usm_advise_exp_params_t;
1418814176

14177+
///////////////////////////////////////////////////////////////////////////////
14178+
/// @brief Function parameters for urCommandBufferEnqueueExp
14179+
/// @details Each entry is a pointer to the parameter passed to the function;
14180+
/// allowing the callback the ability to modify the parameter's value
14181+
typedef struct ur_command_buffer_enqueue_exp_params_t {
14182+
ur_exp_command_buffer_handle_t *phCommandBuffer;
14183+
ur_queue_handle_t *phQueue;
14184+
uint32_t *pnumEventsInWaitList;
14185+
const ur_event_handle_t **pphEventWaitList;
14186+
ur_event_handle_t **pphEvent;
14187+
} ur_command_buffer_enqueue_exp_params_t;
14188+
1418914189
///////////////////////////////////////////////////////////////////////////////
1419014190
/// @brief Function parameters for urCommandBufferUpdateKernelLaunchExp
1419114191
/// @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,7 +132,6 @@ _UR_API(urEnqueueReadHostPipe)
132132
_UR_API(urEnqueueWriteHostPipe)
133133
_UR_API(urEnqueueEventsWaitWithBarrierExt)
134134
_UR_API(urEnqueueKernelLaunchCustomExp)
135-
_UR_API(urEnqueueCommandBufferExp)
136135
_UR_API(urEnqueueCooperativeKernelLaunchExp)
137136
_UR_API(urEnqueueTimestampRecordingExp)
138137
_UR_API(urEnqueueNativeCommandExp)
@@ -182,6 +181,7 @@ _UR_API(urCommandBufferAppendMemBufferReadRectExp)
182181
_UR_API(urCommandBufferAppendMemBufferFillExp)
183182
_UR_API(urCommandBufferAppendUSMPrefetchExp)
184183
_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,12 +1117,6 @@ 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-
11261120
///////////////////////////////////////////////////////////////////////////////
11271121
/// @brief Function-pointer for urEnqueueCooperativeKernelLaunchExp
11281122
typedef ur_result_t(UR_APICALL *ur_pfnEnqueueCooperativeKernelLaunchExp_t)(
@@ -1148,7 +1142,6 @@ typedef ur_result_t(UR_APICALL *ur_pfnEnqueueNativeCommandExp_t)(
11481142
/// @brief Table of EnqueueExp functions pointers
11491143
typedef struct ur_enqueue_exp_dditable_t {
11501144
ur_pfnEnqueueKernelLaunchCustomExp_t pfnKernelLaunchCustomExp;
1151-
ur_pfnEnqueueCommandBufferExp_t pfnCommandBufferExp;
11521145
ur_pfnEnqueueCooperativeKernelLaunchExp_t pfnCooperativeKernelLaunchExp;
11531146
ur_pfnEnqueueTimestampRecordingExp_t pfnTimestampRecordingExp;
11541147
ur_pfnEnqueueNativeCommandExp_t pfnNativeCommandExp;
@@ -1597,6 +1590,12 @@ typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferAppendUSMAdviseExp_t)(
15971590
const ur_event_handle_t *, ur_exp_command_buffer_sync_point_t *,
15981591
ur_event_handle_t *, ur_exp_command_buffer_command_handle_t *);
15991592

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+
16001599
///////////////////////////////////////////////////////////////////////////////
16011600
/// @brief Function-pointer for urCommandBufferUpdateKernelLaunchExp
16021601
typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferUpdateKernelLaunchExp_t)(
@@ -1640,6 +1639,7 @@ typedef struct ur_command_buffer_exp_dditable_t {
16401639
ur_pfnCommandBufferAppendMemBufferFillExp_t pfnAppendMemBufferFillExp;
16411640
ur_pfnCommandBufferAppendUSMPrefetchExp_t pfnAppendUSMPrefetchExp;
16421641
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,16 +2626,6 @@ 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-
26392629
///////////////////////////////////////////////////////////////////////////////
26402630
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
26412631
/// @returns
@@ -3171,6 +3161,16 @@ urPrintCommandBufferAppendUsmAdviseExpParams(
31713161
const struct ur_command_buffer_append_usm_advise_exp_params_t *params,
31723162
char *buffer, const size_t buff_size, size_t *out_size);
31733163

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,6 +1159,9 @@ 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;
11621165
case UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP:
11631166
os << "UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP";
11641167
break;
@@ -1174,9 +1177,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) {
11741177
case UR_FUNCTION_PHYSICAL_MEM_GET_INFO:
11751178
os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO";
11761179
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_ENQUEUE_COMMAND_BUFFER_EXP:
9903-
os << "UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP";
9902+
case UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP:
9903+
os << "UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP";
99049904
break;
99059905
case UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP:
99069906
os << "UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP";
@@ -16205,53 +16205,6 @@ 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-
1625516208
///////////////////////////////////////////////////////////////////////////////
1625616209
/// @brief Print operator for the
1625716210
/// ur_enqueue_cooperative_kernel_launch_exp_params_t type
@@ -18682,6 +18635,53 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1868218635
return os;
1868318636
}
1868418637

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,9 +19890,6 @@ 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;
1989619893
case UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP: {
1989719894
os << (const struct ur_enqueue_cooperative_kernel_launch_exp_params_t *)
1989819895
params;
@@ -20067,6 +20064,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
2006720064
os << (const struct ur_command_buffer_append_usm_advise_exp_params_t *)
2006820065
params;
2006920066
} 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)