Skip to content

Commit 112089f

Browse files
pbalcerkbenzie
authored andcommitted
stop batching multiple CmdList execution when waiting for barriers
The current implementation of queue command batching appears to assume that getAvailableCommandList is followed by a single executeCommandList, and it's not allowed to, for example, create a list of CmdLists for later execution. And there's an assert to check for this. This makes sense, since it doesn't really make sense to batch things across many different CmdLists. However, the implementation of urEnqueueEventsWaitWithBarrier was doing exactly that. This patch disables batching in executeCommandList, fixing a assert failure during urEnqueueEventsWaitWithBarrier when many potentially open command lists are in use.
1 parent a44e81b commit 112089f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/adapters/level_zero/event.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
367367
IsInternal));
368368
}
369369

370+
// When executing command lists, allowing batching simply means storing
371+
// the CmdLists as the current open batch. That's not what we want here.
372+
// Moreover, the current implementation does not allow calling
373+
// executeCommandList after an earlier getAvailableCommandList returned some
374+
// other CmdList.
375+
OkToBatch = false;
370376
// Execute each command list so the barriers can be encountered.
371377
for (ur_command_list_ptr_t &CmdList : CmdLists)
372378
UR_CALL(Queue->executeCommandList(CmdList, false, OkToBatch));

0 commit comments

Comments
 (0)