mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +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
63df08664a
commit
1fedaee18c
@ -52,7 +52,7 @@ HWTEST_F(CommandQueueHwTest, givenNoTimestampPacketsWhenWaitForTimestampsThenNoW
|
||||
auto taskCount = device->getUltCommandStreamReceiver<FamilyType>().peekLatestFlushedTaskCount();
|
||||
auto status = WaitStatus::NotReady;
|
||||
|
||||
cmdQ.waitForTimestamps({}, 101u, status);
|
||||
cmdQ.waitForTimestamps({}, 101u, status, cmdQ.timestampPacketContainer.get(), cmdQ.deferredTimestampPackets.get());
|
||||
|
||||
EXPECT_EQ(device->getUltCommandStreamReceiver<FamilyType>().peekLatestFlushedTaskCount(), taskCount);
|
||||
}
|
||||
|
@ -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, WaitStatus &status) override { return false; };
|
||||
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status, TimestampPacketContainer *mainContainer, TimestampPacketContainer *deferredContainer) 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