@@ -1589,7 +1589,13 @@ struct EnqueueAuxKernelTests : public EnqueueKernelTest {
15891589 dispatchAuxTranslationInputs.emplace_back (lastKernel, multiDispatchInfo.size (), buffersForAuxTranslation, auxTranslationDirection);
15901590 }
15911591
1592+ void waitUntilComplete (uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep) override {
1593+ waitCalled++;
1594+ CommandQueueHw<FamilyType>::waitUntilComplete (taskCountToWait, flushStampToWait, useQuickKmdSleep);
1595+ }
1596+
15921597 std::vector<std::tuple<Kernel *, size_t , BuffersForAuxTranslation, AuxTranslationDirection>> dispatchAuxTranslationInputs;
1598+ uint32_t waitCalled = 0 ;
15931599 };
15941600};
15951601
@@ -1737,3 +1743,25 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTrans
17371743 EXPECT_EQ (GraphicsAllocation::AllocationType::BUFFER, buffer2.getGraphicsAllocation ()->getAllocationType ());
17381744 }
17391745}
1746+
1747+ HWCMDTEST_F (IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTranslationIsRequiredThenMakeEnqueueBlocking) {
1748+ if (pDevice->getSupportedClVersion () >= 20 ) {
1749+ MyCmdQ<FamilyType> cmdQ (context, pDevice);
1750+ size_t gws[3 ] = {1 , 0 , 0 };
1751+
1752+ cl_queue_properties queueProperties = {};
1753+ auto mockDevQueue = std::make_unique<MockDeviceQueueHw<FamilyType>>(context, pDevice, queueProperties);
1754+ context->setDefaultDeviceQueue (mockDevQueue.get ());
1755+ std::unique_ptr<MockParentKernel> parentKernel (MockParentKernel::create (*context, false , false , false , false , false ));
1756+ parentKernel->initialize ();
1757+
1758+ parentKernel->auxTranslationRequired = false ;
1759+ cmdQ.enqueueKernel (parentKernel.get (), 1 , nullptr , gws, nullptr , 0 , nullptr , nullptr );
1760+ EXPECT_EQ (0u , cmdQ.waitCalled );
1761+ mockDevQueue->getIgilQueue ()->m_controls .m_CriticalSection = 0 ;
1762+
1763+ parentKernel->auxTranslationRequired = true ;
1764+ cmdQ.enqueueKernel (parentKernel.get (), 1 , nullptr , gws, nullptr , 0 , nullptr , nullptr );
1765+ EXPECT_EQ (1u , cmdQ.waitCalled );
1766+ }
1767+ }
0 commit comments