@@ -943,6 +943,69 @@ HWTEST_TEMPLATED_F(BlitAuxTranslationTests, givenCacheFlushRequiredWhenHandlingD
943
943
device->getMemoryManager ()->freeGraphicsMemory (gfxAllocation);
944
944
}
945
945
946
+ HWTEST_TEMPLATED_F (BlitAuxTranslationTests, givenTerminatedLatestEnqueuedTaskWhenHandlingDependenciesForBlockedEnqueueThenDoNotPutAllNodesToDeferredListAndSetTimestampData) {
947
+ DebugManager.flags .ForceCacheFlushForBcs .set (1 );
948
+
949
+ auto gfxAllocation = createGfxAllocation (1 , true );
950
+ setMockKernelArgs (std::array<GraphicsAllocation *, 1 >{{gfxAllocation}});
951
+
952
+ TimestampPacketContainer *deferredTimestampPackets = static_cast <MockCommandQueueHw<FamilyType> *>(commandQueue.get ())->deferredTimestampPackets .get ();
953
+ TimestampPacketContainer *timestampPacketContainer = static_cast <MockCommandQueueHw<FamilyType> *>(commandQueue.get ())->timestampPacketContainer .get ();
954
+
955
+ UserEvent userEvent;
956
+ cl_event waitlist[] = {&userEvent};
957
+
958
+ commandQueue->enqueueKernel (mockKernel->mockKernel , 1 , nullptr , gws, nullptr , 1 , waitlist, nullptr );
959
+
960
+ EXPECT_EQ (0u , deferredTimestampPackets->peekNodes ().size ());
961
+
962
+ userEvent.setStatus (-1 );
963
+
964
+ EXPECT_FALSE (commandQueue->isQueueBlocked ());
965
+
966
+ EXPECT_EQ (0u , deferredTimestampPackets->peekNodes ().size ());
967
+ EXPECT_EQ (timestampPacketContainer->peekNodes ()[0 ]->getContextEndValue (0u ), 0xffffffff );
968
+
969
+ device->getMemoryManager ()->freeGraphicsMemory (gfxAllocation);
970
+ }
971
+
972
+ HWTEST_TEMPLATED_F (BlitAuxTranslationTests, givenTerminatedTaskWhenHandlingDependenciesForBlockedEnqueueThenDoNotPutAllNodesToDeferredListAndDoNotSetTimestampData) {
973
+ DebugManager.flags .ForceCacheFlushForBcs .set (1 );
974
+
975
+ auto gfxAllocation = createGfxAllocation (1 , true );
976
+ setMockKernelArgs (std::array<GraphicsAllocation *, 1 >{{gfxAllocation}});
977
+
978
+ TimestampPacketContainer *deferredTimestampPackets = static_cast <MockCommandQueueHw<FamilyType> *>(commandQueue.get ())->deferredTimestampPackets .get ();
979
+ TimestampPacketContainer *timestampPacketContainer = static_cast <MockCommandQueueHw<FamilyType> *>(commandQueue.get ())->timestampPacketContainer .get ();
980
+
981
+ UserEvent userEvent;
982
+ [[maybe_unused]] UserEvent *ue = &userEvent;
983
+ cl_event waitlist[] = {&userEvent};
984
+ UserEvent userEvent1;
985
+ [[maybe_unused]] UserEvent *ue1 = &userEvent1;
986
+ cl_event waitlist1[] = {&userEvent1};
987
+
988
+ commandQueue->enqueueKernel (mockKernel->mockKernel , 1 , nullptr , gws, nullptr , 1 , waitlist, nullptr );
989
+ commandQueue->enqueueKernel (mockKernel->mockKernel , 1 , nullptr , gws, nullptr , 1 , waitlist1, nullptr );
990
+
991
+ EXPECT_EQ (0u , deferredTimestampPackets->peekNodes ().size ());
992
+
993
+ userEvent.setStatus (-1 );
994
+
995
+ EXPECT_EQ (0u , deferredTimestampPackets->peekNodes ().size ());
996
+ EXPECT_EQ (1u , timestampPacketContainer->peekNodes ().size ());
997
+ EXPECT_EQ (timestampPacketContainer->peekNodes ()[0 ]->getContextEndValue (0u ), 1u );
998
+
999
+ userEvent1.setStatus (-1 );
1000
+
1001
+ EXPECT_FALSE (commandQueue->isQueueBlocked ());
1002
+ EXPECT_EQ (0u , deferredTimestampPackets->peekNodes ().size ());
1003
+ EXPECT_EQ (1u , timestampPacketContainer->peekNodes ().size ());
1004
+ EXPECT_EQ (timestampPacketContainer->peekNodes ()[0 ]->getContextEndValue (0u ), 0xffffffff );
1005
+
1006
+ device->getMemoryManager ()->freeGraphicsMemory (gfxAllocation);
1007
+ }
1008
+
946
1009
using BlitEnqueueWithNoTimestampPacketTests = BlitEnqueueTests<0 >;
947
1010
948
1011
HWTEST_TEMPLATED_F (BlitEnqueueWithNoTimestampPacketTests, givenNoTimestampPacketsWritewhenEnqueueingBlitOperationThenEnginesAreSynchronized) {
0 commit comments