Skip to content

Commit

Permalink
Merge pull request #2087 from nrspruit/fix_driver_inorder_event_wait
Browse files Browse the repository at this point in the history
[L0] Fix urEnqueueEventsWaitWithBarrier for driver in order lists
  • Loading branch information
pbalcer authored and kbenzie committed Sep 17, 2024
1 parent 86464eb commit bf4ddf0
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 @@ -529,6 +529,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 @@ -197,7 +197,9 @@ ur_queue_handle_legacy_t_::enqueueEventsWaitWithBarrier( ///< [in] handle of the
//
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 @@ -2371,6 +2371,7 @@ ur_queue_handle_legacy_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 @@ -2386,6 +2387,7 @@ ur_queue_handle_legacy_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 @@ -2434,7 +2436,7 @@ ur_queue_handle_legacy_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 bf4ddf0

Please sign in to comment.