Revert "Wait on timestamps in Event::wait"

This reverts commit f91047f2ee.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-10-08 05:32:43 +02:00
committed by Compute-Runtime-Automation
parent 8e9242dc92
commit 1c73031a9b
5 changed files with 8 additions and 39 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -428,9 +428,7 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) {
}
Range<CopyEngineState> 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;
}

View File

@@ -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> 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);

View File

@@ -212,19 +212,10 @@ class MockCommandQueue : public CommandQueue {
bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const override { return isCacheFlushRequired; }
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status) override {
waitForTimestampsCalled = true;
return false;
};
void clearDeferredTimestampPackets() override {
CommandQueue::clearDeferredTimestampPackets();
clearDeferredTimestampPacketsCalled = true;
}
bool waitForTimestamps(Range<CopyEngineState> 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;