mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 00:58:39 +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
@@ -1209,7 +1209,7 @@ WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *pri
|
||||
}
|
||||
|
||||
auto waitStatus = WaitStatus::NotReady;
|
||||
auto waitedOnTimestamps = waitForTimestamps(activeBcsStates, taskCount, waitStatus);
|
||||
auto waitedOnTimestamps = waitForTimestamps(activeBcsStates, taskCount, waitStatus, this->timestampPacketContainer.get(), this->deferredTimestampPackets.get());
|
||||
if (waitStatus == WaitStatus::GpuHang) {
|
||||
return WaitStatus::GpuHang;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
bool isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState);
|
||||
|
||||
bool isWaitForTimestampsEnabled() const;
|
||||
virtual bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status) = 0;
|
||||
virtual bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status, TimestampPacketContainer *mainContainer, TimestampPacketContainer *deferredContainer) = 0;
|
||||
|
||||
MOCKABLE_VIRTUAL bool isQueueBlocked();
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ class CommandQueueHw : public CommandQueue {
|
||||
|
||||
bool isCacheFlushCommand(uint32_t commandType) const override;
|
||||
|
||||
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status) override;
|
||||
bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status, TimestampPacketContainer *mainContainer, TimestampPacketContainer *deferredContainer) override;
|
||||
|
||||
MOCKABLE_VIRTUAL bool isCacheFlushForBcsRequired() const;
|
||||
|
||||
|
||||
@@ -167,14 +167,14 @@ inline bool waitForTimestampsWithinContainer(TimestampPacketContainer *container
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
bool CommandQueueHw<Family>::waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status) {
|
||||
bool CommandQueueHw<Family>::waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount, WaitStatus &status, TimestampPacketContainer *mainContainer, TimestampPacketContainer *deferredContainer) {
|
||||
using TSPacketType = typename Family::TimestampPacketType;
|
||||
bool waited = false;
|
||||
|
||||
if (isWaitForTimestampsEnabled()) {
|
||||
waited = waitForTimestampsWithinContainer<TSPacketType>(timestampPacketContainer.get(), getGpgpuCommandStreamReceiver(), status);
|
||||
waited = waitForTimestampsWithinContainer<TSPacketType>(mainContainer, getGpgpuCommandStreamReceiver(), status);
|
||||
if (isOOQEnabled()) {
|
||||
waitForTimestampsWithinContainer<TSPacketType>(deferredTimestampPackets.get(), getGpgpuCommandStreamReceiver(), status);
|
||||
waitForTimestampsWithinContainer<TSPacketType>(deferredContainer, getGpgpuCommandStreamReceiver(), status);
|
||||
}
|
||||
|
||||
if (waited) {
|
||||
|
||||
Reference in New Issue
Block a user