Skip to content

Commit

Permalink
Merge pull request oneapi-src#2087 from nrspruit/fix_driver_inorder_e…
Browse files Browse the repository at this point in the history
…vent_wait

[L0] Fix urEnqueueEventsWaitWithBarrier for driver in order lists
  • Loading branch information
pbalcer authored Sep 17, 2024
2 parents fb6df49 + 3f128d0 commit 4d19115
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/adapters/level_zero/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool(
counterBasedExt.flags =
ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE;
}
logger::debug("ze_event_pool_desc_t counter based flags set to: {}",
counterBasedExt.flags);
ZeEventPoolDesc.pNext = &counterBasedExt;
}

Expand Down
4 changes: 3 additions & 1 deletion source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ ur_result_t urEnqueueEventsWaitWithBarrier(
//
if (Queue->isInOrderQueue() && InOrderBarrierBySignal &&
!Queue->isProfilingEnabled()) {
if (EventWaitList.Length) {
// If we are using driver in order lists, then append wait on events
// is unnecessary and we can signal the event created.
if (EventWaitList.Length && !CmdList->second.IsInOrderList) {
ZE2UR_CALL(zeCommandListAppendWaitOnEvents,
(CmdList->first, EventWaitList.Length,
EventWaitList.ZeEventList));
Expand Down
4 changes: 3 additions & 1 deletion source/adapters/level_zero/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,6 +2386,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
ZeCommandQueueDesc.ordinal = QueueOrdinal;
ZeCommandQueueDesc.index = QueueIndex;
ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
bool isInOrderList = false;
const char *Priority = "Normal";
if (Queue->isPriorityLow()) {
ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW;
Expand All @@ -2401,6 +2402,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
}

if (Queue->Device->useDriverInOrderLists() && Queue->isInOrderQueue()) {
isInOrderList = true;
ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER;
}

Expand Down Expand Up @@ -2449,7 +2451,7 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() {
ZeCommandList,
ur_command_list_info_t(
nullptr, true, false, nullptr, ZeCommandQueueDesc,
Queue->useCompletionBatching(), true, false, true)})
Queue->useCompletionBatching(), true, isInOrderList, true)})
.first;

return ImmCmdLists[Index];
Expand Down

0 comments on commit 4d19115

Please sign in to comment.