diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 0841455260..16c3a59793 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -1195,13 +1195,6 @@ bool CommandQueue::isWaitForTimestampsEnabled() const { return enabled; } -void CommandQueue::clearDeferredTimestampPackets() { - TimestampPacketContainer nodesToRelease; - if (deferredTimestampPackets) { - deferredTimestampPackets->swapNodes(nodesToRelease); - } -} - WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *printfHandler, bool cleanTemporaryAllocationsList) { if (blockedQueue) { while (isQueueBlocked()) { @@ -1221,6 +1214,11 @@ WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *pri return WaitStatus::GpuHang; } + TimestampPacketContainer nodesToRelease; + if (deferredTimestampPackets) { + deferredTimestampPackets->swapNodes(nodesToRelease); + } + waitStatus = waitUntilComplete(taskCount, activeBcsStates, flushStamp->peekStamp(), false, cleanTemporaryAllocationsList, waitedOnTimestamps); if (printfHandler) { @@ -1229,8 +1227,6 @@ WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *pri } } - this->clearDeferredTimestampPackets(); - return waitStatus; } diff --git a/opencl/source/command_queue/command_queue.h b/opencl/source/command_queue/command_queue.h index 8c3d1e5fa4..4251ac82da 100644 --- a/opencl/source/command_queue/command_queue.h +++ b/opencl/source/command_queue/command_queue.h @@ -357,8 +357,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> { TimestampPacketContainer *getDeferredTimestampPackets() const { return deferredTimestampPackets.get(); } - MOCKABLE_VIRTUAL void clearDeferredTimestampPackets(); - uint64_t dispatchHints = 0; bool isTextureCacheFlushNeeded(uint32_t commandType) const; diff --git a/opencl/source/event/event.cpp b/opencl/source/event/event.cpp index 726ade869c..956ec73a36 100644 --- a/opencl/source/event/event.cpp +++ b/opencl/source/event/event.cpp @@ -428,9 +428,7 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) { } Range states{&bcsState, bcsState.isValid() ? 1u : 0u}; - auto waitStatus = WaitStatus::NotReady; - auto waitedOnTimestamps = cmdQueue->waitForTimestamps(states, taskCount.load(), waitStatus); - waitStatus = cmdQueue->waitUntilComplete(taskCount.load(), states, flushStamp->peekStamp(), useQuickKmdSleep, true, waitedOnTimestamps); + const auto waitStatus = cmdQueue->waitUntilComplete(taskCount.load(), states, flushStamp->peekStamp(), useQuickKmdSleep); if (waitStatus == WaitStatus::GpuHang) { return WaitStatus::GpuHang; } @@ -441,8 +439,6 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) { auto *allocationStorage = cmdQueue->getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION); - cmdQueue->clearDeferredTimestampPackets(); - return WaitStatus::Ready; } diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 3cbd1074de..02d4d540b3 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -909,18 +909,6 @@ TEST_F(InternalsEventTest, givenPassingEventWhenWaitingForEventsThenWaititingIsS EXPECT_NE(Event::executionAbortedDueToGpuHang, passingEvent.peekExecutionStatus()); } -TEST_F(InternalsEventTest, givenEventWhenWaitThenWaitForTimestampsCalled) { - MockCommandQueue cmdQ(mockContext, pClDevice, nullptr, false); - MockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, 0, 0); - EXPECT_FALSE(cmdQ.waitForTimestampsCalled); - EXPECT_FALSE(cmdQ.clearDeferredTimestampPacketsCalled); - - event.wait(false, false); - - EXPECT_TRUE(cmdQ.waitForTimestampsCalled); - EXPECT_TRUE(cmdQ.clearDeferredTimestampPacketsCalled); -} - TEST_F(InternalsEventTest, GivenProfilingWHENMapOperationTHENTimesSet) { const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0}; MockCommandQueue *pCmdQ = new MockCommandQueue(mockContext, pClDevice, props, false); diff --git a/opencl/test/unit_test/mocks/mock_command_queue.h b/opencl/test/unit_test/mocks/mock_command_queue.h index f52c9cc688..c123735dcd 100644 --- a/opencl/test/unit_test/mocks/mock_command_queue.h +++ b/opencl/test/unit_test/mocks/mock_command_queue.h @@ -212,19 +212,10 @@ class MockCommandQueue : public CommandQueue { bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const override { return isCacheFlushRequired; } - bool waitForTimestamps(Range copyEnginesToWait, uint32_t taskCount, WaitStatus &status) override { - waitForTimestampsCalled = true; - return false; - }; - - void clearDeferredTimestampPackets() override { - CommandQueue::clearDeferredTimestampPackets(); - clearDeferredTimestampPacketsCalled = true; - } + bool waitForTimestamps(Range copyEnginesToWait, uint32_t taskCount, WaitStatus &status) override { return false; }; bool releaseIndirectHeapCalled = false; - bool waitForTimestampsCalled = false; - bool clearDeferredTimestampPacketsCalled = false; + cl_int writeBufferRetValue = CL_SUCCESS; uint32_t writeBufferCounter = 0; bool writeBufferBlocking = false;