@@ -311,6 +311,28 @@ HWTEST_F(BcsTests, givenMultipleBlitPropertiesWhenDispatchingThenProgramCommands
311311 EXPECT_EQ (2u , dependenciesFound);
312312}
313313
314+ HWTEST_F (BcsTests, whenBlitBufferThenCommandBufferHasProperTaskCount) {
315+ auto &csr = pDevice->getUltCommandStreamReceiver <FamilyType>();
316+
317+ cl_int retVal = CL_SUCCESS;
318+ auto buffer = clUniquePtr<Buffer>(Buffer::create (context.get (), CL_MEM_READ_WRITE, 1 , nullptr , retVal));
319+ void *hostPtr = reinterpret_cast <void *>(0x12340000 );
320+ auto graphicsAllocation = buffer->getGraphicsAllocation (pDevice->getRootDeviceIndex ());
321+
322+ auto blitProperties = BlitProperties::constructPropertiesForReadWrite (BlitterConstants::BlitDirection::HostPtrToBuffer,
323+ csr, graphicsAllocation, nullptr , hostPtr,
324+ graphicsAllocation->getGpuAddress (), 0 ,
325+ 0 , 0 , {1 , 1 , 1 }, 0 , 0 , 0 , 0 );
326+
327+ BlitPropertiesContainer blitPropertiesContainer;
328+ blitPropertiesContainer.push_back (blitProperties);
329+
330+ csr.blitBuffer (blitPropertiesContainer, true , false );
331+
332+ EXPECT_EQ (csr.getCS (0u ).getGraphicsAllocation ()->getTaskCount (csr.getOsContext ().getContextId ()), csr.peekTaskCount ());
333+ EXPECT_EQ (csr.getCS (0u ).getGraphicsAllocation ()->getResidencyTaskCount (csr.getOsContext ().getContextId ()), csr.peekTaskCount ());
334+ }
335+
314336HWTEST_F (BcsTests, givenProfilingEnabledWhenBlitBufferThenCommandBufferIsConstructedProperly) {
315337 auto bcsOsContext = std::unique_ptr<OsContext>(OsContext::create (nullptr , 0 , pDevice->getDeviceBitfield (), EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false ));
316338 auto bcsCsr = std::make_unique<UltCommandStreamReceiver<FamilyType>>(*pDevice->getExecutionEnvironment (), pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ());
0 commit comments