File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments