mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Add wait on timestamp mechanism
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
59bcfc30a5
commit
36efe72e3e
@@ -955,6 +955,58 @@ void CommandQueue::aubCaptureHook(bool &blocking, bool &clearAllDependencies, co
|
||||
}
|
||||
}
|
||||
|
||||
bool CommandQueue::isTimestampWaitEnabled() {
|
||||
auto enabled = false;
|
||||
|
||||
switch (DebugManager.flags.EnableTimestampWait.get()) {
|
||||
case 0:
|
||||
enabled = false;
|
||||
break;
|
||||
case 1:
|
||||
enabled = getGpgpuCommandStreamReceiver().isUpdateTagFromWaitEnabled();
|
||||
break;
|
||||
case 2:
|
||||
enabled = getGpgpuCommandStreamReceiver().isDirectSubmissionEnabled();
|
||||
break;
|
||||
case 3:
|
||||
enabled = getGpgpuCommandStreamReceiver().isAnyDirectSubmissionEnabled();
|
||||
break;
|
||||
case 4:
|
||||
enabled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
void CommandQueue::waitForTimestamps(uint32_t taskCount) {
|
||||
if (isTimestampWaitEnabled()) {
|
||||
bool waited = false;
|
||||
|
||||
for (const auto ×tamp : timestampPacketContainer->peekNodes()) {
|
||||
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
|
||||
while (timestamp->getContextEndValue(i) == 1) {
|
||||
}
|
||||
waited = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isOOQEnabled()) {
|
||||
for (const auto ×tamp : 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()) {
|
||||
@@ -963,6 +1015,7 @@ void CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *printfHan
|
||||
|
||||
TimestampPacketContainer nodesToRelease;
|
||||
if (deferredTimestampPackets) {
|
||||
waitForTimestamps(taskCount);
|
||||
deferredTimestampPackets->swapNodes(nodesToRelease);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user