Skip to content

Commit 4d19115

Browse files
authored
Merge pull request #2087 from nrspruit/fix_driver_inorder_event_wait
[L0] Fix urEnqueueEventsWaitWithBarrier for driver in order lists
2 parents fb6df49 + 3f128d0 commit 4d19115

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

source/adapters/level_zero/context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool(
530530
counterBasedExt.flags =
531531
ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE;
532532
}
533+
logger::debug("ze_event_pool_desc_t counter based flags set to: {}",
534+
counterBasedExt.flags);
533535
ZeEventPoolDesc.pNext = &counterBasedExt;
534536
}
535537

source/adapters/level_zero/event.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
196196
//
197197
if (Queue->isInOrderQueue() && InOrderBarrierBySignal &&
198198
!Queue->isProfilingEnabled()) {
199-
if (EventWaitList.Length) {
199+
// If we are using driver in order lists, then append wait on events
200+
// is unnecessary and we can signal the event created.
201+
if (EventWaitList.Length && !CmdList->second.IsInOrderList) {
200202
ZE2UR_CALL(zeCommandListAppendWaitOnEvents,
201203
(CmdList->first, EventWaitList.Length,
202204
EventWaitList.ZeEventList));

source/adapters/level_zero/queue.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
23862386
ZeCommandQueueDesc.ordinal = QueueOrdinal;
23872387
ZeCommandQueueDesc.index = QueueIndex;
23882388
ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
2389+
bool isInOrderList = false;
23892390
const char *Priority = "Normal";
23902391
if (Queue->isPriorityLow()) {
23912392
ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW;
@@ -2401,6 +2402,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
24012402
}
24022403

24032404
if (Queue->Device->useDriverInOrderLists() && Queue->isInOrderQueue()) {
2405+
isInOrderList = true;
24042406
ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER;
24052407
}
24062408

@@ -2449,7 +2451,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
24492451
ZeCommandList,
24502452
ur_command_list_info_t(
24512453
nullptr, true, false, nullptr, ZeCommandQueueDesc,
2452-
Queue->useCompletionBatching(), true, false, true)})
2454+
Queue->useCompletionBatching(), true, isInOrderList, true)})
24532455
.first;
24542456

24552457
return ImmCmdLists[Index];

0 commit comments

Comments
 (0)