@@ -188,7 +188,7 @@ bool CommandQueue::isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState
188188 return false ;
189189}
190190
191- void CommandQueue::waitUntilComplete (uint32_t gpgpuTaskCountToWait, uint32_t bcsTaskCountToWait , FlushStamp flushStampToWait, bool useQuickKmdSleep) {
191+ void CommandQueue::waitUntilComplete (uint32_t gpgpuTaskCountToWait, Range<CopyEngineState> copyEnginesToWait , FlushStamp flushStampToWait, bool useQuickKmdSleep) {
192192 WAIT_ENTER ()
193193
194194 DBG_LOG (LogTaskCounts, __FUNCTION__, " Waiting for taskCount:" , gpgpuTaskCountToWait);
@@ -206,10 +206,10 @@ void CommandQueue::waitUntilComplete(uint32_t gpgpuTaskCountToWait, uint32_t bcs
206206 gtpinNotifyTaskCompletion (gpgpuTaskCountToWait);
207207 }
208208
209- if (bcsEngine ) {
210- auto bcsCsr = getBcsCommandStreamReceiver (bcsEngine-> getEngineType () );
211- bcsCsr->waitForTaskCountWithKmdNotifyFallback (bcsTaskCountToWait , 0 , false , false );
212- bcsCsr->waitForTaskCountAndCleanTemporaryAllocationList (bcsTaskCountToWait );
209+ for ( const CopyEngineState ©Engine : copyEnginesToWait ) {
210+ auto bcsCsr = getBcsCommandStreamReceiver (copyEngine. engineType );
211+ bcsCsr->waitForTaskCountWithKmdNotifyFallback (copyEngine. taskCount , 0 , false , false );
212+ bcsCsr->waitForTaskCountAndCleanTemporaryAllocationList (copyEngine. taskCount );
213213 }
214214
215215 getGpgpuCommandStreamReceiver ().waitForTaskCountAndCleanTemporaryAllocationList (gpgpuTaskCountToWait);
@@ -919,7 +919,8 @@ void CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *printfHan
919919 deferredTimestampPackets->swapNodes (nodesToRelease);
920920 }
921921
922- waitUntilComplete (taskCount, this ->bcsState .taskCount , flushStamp->peekStamp (), false );
922+ Range<CopyEngineState> states{&bcsState, bcsState.isValid () ? 1u : 0u };
923+ waitUntilComplete (taskCount, states, flushStamp->peekStamp (), false );
923924
924925 if (printfHandler) {
925926 printfHandler->printEnqueueOutput ();
0 commit comments