diff --git a/opencl/source/event/event.cpp b/opencl/source/event/event.cpp index a88177bc7a..87e07ef3d7 100644 --- a/opencl/source/event/event.cpp +++ b/opencl/source/event/event.cpp @@ -685,6 +685,7 @@ bool Event::areTimestampsCompleted() { if (this->cmdQueue->isWaitForTimestampsEnabled()) { for (const auto ×tamp : this->timestampPacketContainer->peekNodes()) { for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) { + this->cmdQueue->getGpgpuCommandStreamReceiver().downloadAllocation(*timestamp->getBaseGraphicsAllocation()->getGraphicsAllocation(this->cmdQueue->getGpgpuCommandStreamReceiver().getRootDeviceIndex())); if (timestamp->getContextEndValue(i) == 1) { return false; } diff --git a/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp index 79cfb15d58..32bbee580e 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp @@ -802,8 +802,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size()); EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size()); + EXPECT_FALSE(csr.downloadAllocationCalled); EXPECT_FALSE(event1.isCompleted()); EXPECT_FALSE(event2.isCompleted()); + EXPECT_TRUE(csr.downloadAllocationCalled); + csr.downloadAllocationCalled = false; typename FamilyType::TimestampPacketType timestampData[] = {2, 2, 2, 2}; for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) { @@ -812,6 +815,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen EXPECT_TRUE(event1.isCompleted()); EXPECT_FALSE(event2.isCompleted()); + EXPECT_TRUE(csr.downloadAllocationCalled); + csr.downloadAllocationCalled = false; for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) { timestampPacketContainer->peekNodes()[0]->assignDataToAllTimestamps(i, timestampData); @@ -819,12 +824,15 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen EXPECT_TRUE(event1.isCompleted()); EXPECT_TRUE(event2.isCompleted()); + EXPECT_TRUE(csr.downloadAllocationCalled); + csr.downloadAllocationCalled = false; cmdQ->finish(); EXPECT_TRUE(event1.isCompleted()); EXPECT_TRUE(event2.isCompleted()); EXPECT_EQ(csr.waitForCompletionWithTimeoutTaskCountCalled, 0u); + EXPECT_TRUE(csr.downloadAllocationCalled); clReleaseEvent(clEvent1); clReleaseEvent(clEvent2);