Use wait utils while waiting for timestamps

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2021-12-01 16:37:46 +00:00
committed by Compute-Runtime-Automation
parent 4d433d8674
commit 63116e4100
12 changed files with 122 additions and 32 deletions

View File

@@ -978,34 +978,6 @@ bool CommandQueue::isTimestampWaitEnabled() {
return enabled;
}
void CommandQueue::waitForTimestamps(uint32_t taskCount) {
if (isTimestampWaitEnabled()) {
bool waited = false;
for (const auto &timestamp : timestampPacketContainer->peekNodes()) {
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
while (timestamp->getContextEndValue(i) == 1) {
}
waited = true;
}
}
if (isOOQEnabled()) {
for (const auto &timestamp : deferredTimestampPackets->peekNodes()) {
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
while (timestamp->getContextEndValue(i) == 1) {
}
waited = true;
}
}
}
if (waited) {
getGpgpuCommandStreamReceiver().updateTagFromCpu(taskCount);
}
}
}
void CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *printfHandler, bool cleanTemporaryAllocationsList) {
if (blockedQueue) {
while (isQueueBlocked()) {