Skip to content

Commit c62847a

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 #2600
1 parent d3e9704 commit c62847a

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

+378
-355
lines changed

include/ur_api.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ typedef enum ur_function_t {
423423
UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP = 240,
424424
/// Enumerator for ::urCommandBufferAppendUSMAdviseExp
425425
UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP = 241,
426-
/// Enumerator for ::urCommandBufferEnqueueExp
427-
UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP = 242,
428426
/// Enumerator for ::urCommandBufferUpdateSignalEventExp
429427
UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243,
430428
/// Enumerator for ::urCommandBufferUpdateWaitEventsExp
@@ -439,6 +437,8 @@ typedef enum ur_function_t {
439437
UR_FUNCTION_TENSOR_MAP_ENCODE_TILED_EXP = 248,
440438
/// Enumerator for ::urPhysicalMemGetInfo
441439
UR_FUNCTION_PHYSICAL_MEM_GET_INFO = 249,
440+
/// Enumerator for ::urEnqueueCommandBufferExp
441+
UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP = 250,
442442
/// @cond
443443
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
444444
/// @endcond
@@ -7039,8 +7039,8 @@ typedef enum ur_command_t {
70397039
UR_COMMAND_READ_HOST_PIPE = 25,
70407040
/// Event created by ::urEnqueueWriteHostPipe
70417041
UR_COMMAND_WRITE_HOST_PIPE = 26,
7042-
/// Event created by ::urCommandBufferEnqueueExp
7043-
UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP = 0x1000,
7042+
/// Event created by ::urEnqueueCommandBufferExp
7043+
UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP = 0x1000,
70447044
/// Event created by ::urBindlessImagesWaitExternalSemaphoreExp
70457045
UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP = 0x2000,
70467046
/// 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
@@ -13812,6 +13812,18 @@ typedef struct ur_enqueue_events_wait_with_barrier_ext_params_t {
1381213812
ur_event_handle_t **pphEvent;
1381313813
} ur_enqueue_events_wait_with_barrier_ext_params_t;
1381413814

13815+
///////////////////////////////////////////////////////////////////////////////
13816+
/// @brief Function parameters for urEnqueueCommandBufferExp
13817+
/// @details Each entry is a pointer to the parameter passed to the function;
13818+
/// allowing the callback the ability to modify the parameter's value
13819+
typedef struct ur_enqueue_command_buffer_exp_params_t {
13820+
ur_queue_handle_t *phQueue;
13821+
ur_exp_command_buffer_handle_t *phCommandBuffer;
13822+
uint32_t *pnumEventsInWaitList;
13823+
const ur_event_handle_t **pphEventWaitList;
13824+
ur_event_handle_t **pphEvent;
13825+
} ur_enqueue_command_buffer_exp_params_t;
13826+
1381513827
///////////////////////////////////////////////////////////////////////////////
1381613828
/// @brief Function parameters for urEnqueueCooperativeKernelLaunchExp
1381713829
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -14491,18 +14503,6 @@ typedef struct ur_command_buffer_append_usm_advise_exp_params_t {
1449114503
ur_exp_command_buffer_command_handle_t **pphCommand;
1449214504
} ur_command_buffer_append_usm_advise_exp_params_t;
1449314505

14494-
///////////////////////////////////////////////////////////////////////////////
14495-
/// @brief Function parameters for urCommandBufferEnqueueExp
14496-
/// @details Each entry is a pointer to the parameter passed to the function;
14497-
/// allowing the callback the ability to modify the parameter's value
14498-
typedef struct ur_command_buffer_enqueue_exp_params_t {
14499-
ur_exp_command_buffer_handle_t *phCommandBuffer;
14500-
ur_queue_handle_t *phQueue;
14501-
uint32_t *pnumEventsInWaitList;
14502-
const ur_event_handle_t **pphEventWaitList;
14503-
ur_event_handle_t **pphEvent;
14504-
} ur_command_buffer_enqueue_exp_params_t;
14505-
1450614506
///////////////////////////////////////////////////////////////////////////////
1450714507
/// @brief Function parameters for urCommandBufferRetainCommandExp
1450814508
/// @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(urCommandBufferRetainCommandExp)
186186
_UR_API(urCommandBufferReleaseCommandExp)
187187
_UR_API(urCommandBufferUpdateKernelLaunchExp)

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 urCommandBufferRetainCommandExp
16011602
typedef ur_result_t(UR_APICALL *ur_pfnCommandBufferRetainCommandExp_t)(
@@ -1655,7 +1656,6 @@ typedef struct ur_command_buffer_exp_dditable_t {
16551656
ur_pfnCommandBufferAppendMemBufferFillExp_t pfnAppendMemBufferFillExp;
16561657
ur_pfnCommandBufferAppendUSMPrefetchExp_t pfnAppendUSMPrefetchExp;
16571658
ur_pfnCommandBufferAppendUSMAdviseExp_t pfnAppendUSMAdviseExp;
1658-
ur_pfnCommandBufferEnqueueExp_t pfnEnqueueExp;
16591659
ur_pfnCommandBufferRetainCommandExp_t pfnRetainCommandExp;
16601660
ur_pfnCommandBufferReleaseCommandExp_t pfnReleaseCommandExp;
16611661
ur_pfnCommandBufferUpdateKernelLaunchExp_t pfnUpdateKernelLaunchExp;

include/ur_print.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -2676,6 +2676,16 @@ urPrintEnqueueEventsWaitWithBarrierExtParams(
26762676
const struct ur_enqueue_events_wait_with_barrier_ext_params_t *params,
26772677
char *buffer, const size_t buff_size, size_t *out_size);
26782678

2679+
///////////////////////////////////////////////////////////////////////////////
2680+
/// @brief Print ur_enqueue_command_buffer_exp_params_t struct
2681+
/// @returns
2682+
/// - ::UR_RESULT_SUCCESS
2683+
/// - ::UR_RESULT_ERROR_INVALID_SIZE
2684+
/// - `buff_size < out_size`
2685+
UR_APIEXPORT ur_result_t UR_APICALL urPrintEnqueueCommandBufferExpParams(
2686+
const struct ur_enqueue_command_buffer_exp_params_t *params, char *buffer,
2687+
const size_t buff_size, size_t *out_size);
2688+
26792689
///////////////////////////////////////////////////////////////////////////////
26802690
/// @brief Print ur_enqueue_cooperative_kernel_launch_exp_params_t struct
26812691
/// @returns
@@ -3211,16 +3221,6 @@ urPrintCommandBufferAppendUsmAdviseExpParams(
32113221
const struct ur_command_buffer_append_usm_advise_exp_params_t *params,
32123222
char *buffer, const size_t buff_size, size_t *out_size);
32133223

3214-
///////////////////////////////////////////////////////////////////////////////
3215-
/// @brief Print ur_command_buffer_enqueue_exp_params_t struct
3216-
/// @returns
3217-
/// - ::UR_RESULT_SUCCESS
3218-
/// - ::UR_RESULT_ERROR_INVALID_SIZE
3219-
/// - `buff_size < out_size`
3220-
UR_APIEXPORT ur_result_t UR_APICALL urPrintCommandBufferEnqueueExpParams(
3221-
const struct ur_command_buffer_enqueue_exp_params_t *params, char *buffer,
3222-
const size_t buff_size, size_t *out_size);
3223-
32243224
///////////////////////////////////////////////////////////////////////////////
32253225
/// @brief Print ur_command_buffer_retain_command_exp_params_t struct
32263226
/// @returns

include/ur_print.hpp

+55-55
Original file line numberDiff line numberDiff line change
@@ -1200,9 +1200,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) {
12001200
case UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP:
12011201
os << "UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP";
12021202
break;
1203-
case UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP:
1204-
os << "UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP";
1205-
break;
12061203
case UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP:
12071204
os << "UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP";
12081205
break;
@@ -1224,6 +1221,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) {
12241221
case UR_FUNCTION_PHYSICAL_MEM_GET_INFO:
12251222
os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO";
12261223
break;
1224+
case UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP:
1225+
os << "UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP";
1226+
break;
12271227
default:
12281228
os << "unknown enumerator";
12291229
break;
@@ -9865,8 +9865,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_command_t value) {
98659865
case UR_COMMAND_WRITE_HOST_PIPE:
98669866
os << "UR_COMMAND_WRITE_HOST_PIPE";
98679867
break;
9868-
case UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP:
9869-
os << "UR_COMMAND_COMMAND_BUFFER_ENQUEUE_EXP";
9868+
case UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP:
9869+
os << "UR_COMMAND_ENQUEUE_COMMAND_BUFFER_EXP";
98709870
break;
98719871
case UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP:
98729872
os << "UR_COMMAND_EXTERNAL_SEMAPHORE_WAIT_EXP";
@@ -16693,6 +16693,53 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1669316693
return os;
1669416694
}
1669516695

16696+
///////////////////////////////////////////////////////////////////////////////
16697+
/// @brief Print operator for the ur_enqueue_command_buffer_exp_params_t type
16698+
/// @returns
16699+
/// std::ostream &
16700+
inline std::ostream &
16701+
operator<<(std::ostream &os,
16702+
[[maybe_unused]] const struct ur_enqueue_command_buffer_exp_params_t
16703+
*params) {
16704+
16705+
os << ".hQueue = ";
16706+
16707+
ur::details::printPtr(os, *(params->phQueue));
16708+
16709+
os << ", ";
16710+
os << ".hCommandBuffer = ";
16711+
16712+
ur::details::printPtr(os, *(params->phCommandBuffer));
16713+
16714+
os << ", ";
16715+
os << ".numEventsInWaitList = ";
16716+
16717+
os << *(params->pnumEventsInWaitList);
16718+
16719+
os << ", ";
16720+
os << ".phEventWaitList = ";
16721+
ur::details::printPtr(
16722+
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
16723+
if (*(params->pphEventWaitList) != NULL) {
16724+
os << " {";
16725+
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
16726+
if (i != 0) {
16727+
os << ", ";
16728+
}
16729+
16730+
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
16731+
}
16732+
os << "}";
16733+
}
16734+
16735+
os << ", ";
16736+
os << ".phEvent = ";
16737+
16738+
ur::details::printPtr(os, *(params->pphEvent));
16739+
16740+
return os;
16741+
}
16742+
1669616743
///////////////////////////////////////////////////////////////////////////////
1669716744
/// @brief Print operator for the
1669816745
/// ur_enqueue_cooperative_kernel_launch_exp_params_t type
@@ -19123,53 +19170,6 @@ operator<<(std::ostream &os, [[maybe_unused]] const struct
1912319170
return os;
1912419171
}
1912519172

19126-
///////////////////////////////////////////////////////////////////////////////
19127-
/// @brief Print operator for the ur_command_buffer_enqueue_exp_params_t type
19128-
/// @returns
19129-
/// std::ostream &
19130-
inline std::ostream &
19131-
operator<<(std::ostream &os,
19132-
[[maybe_unused]] const struct ur_command_buffer_enqueue_exp_params_t
19133-
*params) {
19134-
19135-
os << ".hCommandBuffer = ";
19136-
19137-
ur::details::printPtr(os, *(params->phCommandBuffer));
19138-
19139-
os << ", ";
19140-
os << ".hQueue = ";
19141-
19142-
ur::details::printPtr(os, *(params->phQueue));
19143-
19144-
os << ", ";
19145-
os << ".numEventsInWaitList = ";
19146-
19147-
os << *(params->pnumEventsInWaitList);
19148-
19149-
os << ", ";
19150-
os << ".phEventWaitList = ";
19151-
ur::details::printPtr(
19152-
os, reinterpret_cast<const void *>(*(params->pphEventWaitList)));
19153-
if (*(params->pphEventWaitList) != NULL) {
19154-
os << " {";
19155-
for (size_t i = 0; i < *params->pnumEventsInWaitList; ++i) {
19156-
if (i != 0) {
19157-
os << ", ";
19158-
}
19159-
19160-
ur::details::printPtr(os, (*(params->pphEventWaitList))[i]);
19161-
}
19162-
os << "}";
19163-
}
19164-
19165-
os << ", ";
19166-
os << ".phEvent = ";
19167-
19168-
ur::details::printPtr(os, *(params->pphEvent));
19169-
19170-
return os;
19171-
}
19172-
1917319173
///////////////////////////////////////////////////////////////////////////////
1917419174
/// @brief Print operator for the ur_command_buffer_retain_command_exp_params_t
1917519175
/// type
@@ -20626,6 +20626,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
2062620626
os << (const struct ur_enqueue_events_wait_with_barrier_ext_params_t *)
2062720627
params;
2062820628
} break;
20629+
case UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP: {
20630+
os << (const struct ur_enqueue_command_buffer_exp_params_t *)params;
20631+
} break;
2062920632
case UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP: {
2063020633
os << (const struct ur_enqueue_cooperative_kernel_launch_exp_params_t *)
2063120634
params;
@@ -20800,9 +20803,6 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os,
2080020803
os << (const struct ur_command_buffer_append_usm_advise_exp_params_t *)
2080120804
params;
2080220805
} break;
20803-
case UR_FUNCTION_COMMAND_BUFFER_ENQUEUE_EXP: {
20804-
os << (const struct ur_command_buffer_enqueue_exp_params_t *)params;
20805-
} break;
2080620806
case UR_FUNCTION_COMMAND_BUFFER_RETAIN_COMMAND_EXP: {
2080720807
os << (const struct ur_command_buffer_retain_command_exp_params_t *)params;
2080820808
} break;

0 commit comments

Comments
 (0)