Skip to content

Commit 3b92549

Browse files
[L0] Fixed doubled execution of cmdlist
During executeAllCommandList we check if all events associated with list has been signaled, if so we do not execute commandlist. Signed-off-by: Winston Zhang <[email protected]>
1 parent 2bb39a8 commit 3b92549

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/adapters/level_zero/queue.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,16 @@ ur_queue_handle_t_::executeCommandList(ur_command_list_ptr_t CommandList,
13381338
}
13391339

13401340
if (!UsingImmCmdLists) {
1341+
for (auto &Event : CommandList->second.EventList) {
1342+
if (Event->ZeEvent) {
1343+
ze_result_t ZeResult =
1344+
ZE_CALL_NOCHECK(zeEventQueryStatus, (Event->ZeEvent));
1345+
if (ZeResult == ZE_RESULT_SUCCESS)
1346+
numComplete++;
1347+
}
1348+
}
1349+
if (numComplete == CommandList->second.EventList.size())
1350+
return UR_RESULT_SUCCESS;
13411351
// In this mode all inner-batch events have device visibility only,
13421352
// and we want the last command in the batch to signal a host-visible
13431353
// event that anybody waiting for any event in the batch will

0 commit comments

Comments
 (0)