mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Wait on timestamps in Event::wait
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
4dfa615157
commit
5d4aca361f
@ -428,7 +428,8 @@ inline WaitStatus Event::wait(bool blocking, bool useQuickKmdSleep) {
|
||||
}
|
||||
|
||||
Range<CopyEngineState> states{&bcsState, bcsState.isValid() ? 1u : 0u};
|
||||
const auto waitStatus = cmdQueue->waitUntilComplete(taskCount.load(), states, flushStamp->peekStamp(), useQuickKmdSleep);
|
||||
auto waitedOnTimestamps = cmdQueue->waitForTimestamps(states, taskCount.load());
|
||||
const auto waitStatus = cmdQueue->waitUntilComplete(taskCount.load(), states, flushStamp->peekStamp(), useQuickKmdSleep, true, waitedOnTimestamps);
|
||||
if (waitStatus == WaitStatus::GpuHang) {
|
||||
return WaitStatus::GpuHang;
|
||||
}
|
||||
|
@ -909,6 +909,16 @@ 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);
|
||||
|
||||
event.wait(false, false);
|
||||
|
||||
EXPECT_TRUE(cmdQ.waitForTimestampsCalled);
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -212,10 +212,13 @@ class MockCommandQueue : public CommandQueue {
|
||||
|
||||
bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const override { return isCacheFlushRequired; }
|
||||
|
||||
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount) override { return false; };
|
||||
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount) override {
|
||||
waitForTimestampsCalled = true;
|
||||
return false;
|
||||
};
|
||||
|
||||
bool releaseIndirectHeapCalled = false;
|
||||
|
||||
bool waitForTimestampsCalled = false;
|
||||
cl_int writeBufferRetValue = CL_SUCCESS;
|
||||
uint32_t writeBufferCounter = 0;
|
||||
bool writeBufferBlocking = false;
|
||||
|
Reference in New Issue
Block a user