Skip to content

Commit c1aa839

Browse files
committed
[L0] Use check for event batch for integrated when retreiving cmd list
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent c313bdf commit c1aa839

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

source/adapters/level_zero/context.cpp

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -657,23 +657,12 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(
657657
// for this queue.
658658
if (Queue->hasOpenCommandList(UseCopyEngine)) {
659659
if (AllowBatching) {
660-
bool CannotBatch = false;
661-
// If this command should be batched, but the command has a dependency on
662-
// a command in the current batch, then the open command list must be
663-
// executed and this command must be batched into a new command list.
664-
if (NumEventsInWaitList > 0) {
665-
for (auto &Event : CommandBatch.OpenCommandList->second.EventList) {
666-
for (uint32_t i = 0; i < NumEventsInWaitList; i++) {
667-
if (Event == EventWaitList[i]) {
668-
CannotBatch = true;
669-
break;
670-
}
671-
}
672-
if (CannotBatch)
673-
break;
674-
}
660+
bool batchingAllowed = true;
661+
if (Queue->Device->isIntegrated()) {
662+
batchingAllowed = eventCanBeBatched(Queue, UseCopyEngine,
663+
NumEventsInWaitList, EventWaitList);
675664
}
676-
if (!CannotBatch) {
665+
if (batchingAllowed) {
677666
CommandList = CommandBatch.OpenCommandList;
678667
UR_CALL(Queue->insertStartBarrierIfDiscardEventsMode(CommandList));
679668
return UR_RESULT_SUCCESS;

0 commit comments

Comments
 (0)