Skip to content

Commit 47102cb

Browse files
authored
Merge pull request #1328 from Bensuo/maxime/events-reset-bugfix
[EXP][CMDBUF] Reset events for multiple submissions (bugfix)
2 parents 186bfb9 + 2390664 commit 47102cb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

source/adapters/level_zero/command_buffer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
5252
┌─────────────────────────────────────────────┐──────────────┐
5353
Suffix │Barrier waiting on sync-point event, │ Query CMD │
54-
signalling the UR command-buffer signal event│ Timestamps │
54+
signaling the UR command-buffer signal event │ Timestamps │
5555
└─────────────────────────────────────────────┘──────────────┘
5656
5757
For a call to `urCommandBufferEnqueueExp` with an event_list `EL`,
@@ -559,7 +559,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
559559

560560
LaunchEvent->CommandData = (void *)Kernel;
561561
// Increment the reference count of the Kernel and indicate that the Kernel
562-
// is in use. Once the event has been signalled, the code in
562+
// is in use. Once the event has been signaled, the code in
563563
// CleanupCompletedEvent(Event) will do a urKernelRelease to update the
564564
// reference count on the kernel, using the kernel saved in CommandData.
565565
UR_CALL(urKernelRetain(Kernel));
@@ -875,7 +875,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
875875
// Create a list of events of all the events that compose the command buffer
876876
// workload.
877877
// This loop also resets the L0 events we use for command-buffer internal
878-
// sync-points to the non-signalled state.
878+
// sync-points to the non-signaled state.
879879
// This is required for multiple submissions.
880880
const size_t NumEvents = CommandBuffer->SyncPoints.size();
881881
std::vector<ze_event_handle_t> WaitEventList{NumEvents};
@@ -904,14 +904,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
904904
(WaitCommandList->first, CommandBuffer->WaitEvent->ZeEvent,
905905
CommandBuffer->WaitEvent->WaitList.Length,
906906
CommandBuffer->WaitEvent->WaitList.ZeEventList));
907-
Queue->executeCommandList(WaitCommandList, false, false);
908907
MustSignalWaitEvent = false;
909908
}
910909
}
911-
912910
if (MustSignalWaitEvent) {
913-
ZE2UR_CALL(zeEventHostSignal, (CommandBuffer->WaitEvent->ZeEvent));
911+
ZE2UR_CALL(zeCommandListAppendSignalEvent,
912+
(WaitCommandList->first, CommandBuffer->WaitEvent->ZeEvent));
914913
}
914+
Queue->executeCommandList(WaitCommandList, false, false);
915915

916916
// Submit main command-list. This command-list is of a batch command-list
917917
// type, regardless of the UR Queue type. We therefore need to submit the list
@@ -927,7 +927,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
927927
ur_command_list_ptr_t SignalCommandList{};
928928
UR_CALL(Queue->Context->getAvailableCommandList(Queue, SignalCommandList,
929929
false, false));
930-
// Reset the wait-event for the UR command-buffer that is signalled when its
930+
// Reset the wait-event for the UR command-buffer that is signaled when its
931931
// submission dependencies have been satisfied.
932932
ZE2UR_CALL(zeCommandListAppendEventReset,
933933
(SignalCommandList->first, CommandBuffer->WaitEvent->ZeEvent));

0 commit comments

Comments
 (0)