fix: Print printf output on append to imm synchronous cmd lists

Related-To: NEO-7625

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-01-20 10:19:15 +00:00
committed by Compute-Runtime-Automation
parent 28bf57959e
commit 53971a2d28
3 changed files with 69 additions and 1 deletions

View File

@@ -149,6 +149,7 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily<gfxCoreFami
void checkWaitEventsState(uint32_t numWaitEvents, ze_event_handle_t *waitEventList);
protected:
void printKernelsPrintfOutput(bool hangDetected);
std::atomic<bool> dependenciesPresent{false};
};

View File

@@ -240,14 +240,15 @@ inline ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::executeCommand
auto timeoutMicroseconds = NEO::TimeoutControls::maxTimeout;
const auto waitStatus = csr->waitForCompletionWithTimeout(NEO::WaitParams{false, false, timeoutMicroseconds}, completionStamp.taskCount);
if (waitStatus == NEO::WaitStatus::GpuHang) {
this->printKernelsPrintfOutput(true);
return ZE_RESULT_ERROR_DEVICE_LOST;
}
csr->getInternalAllocationStorage()->cleanAllocationList(completionStamp.taskCount, NEO::AllocationUsage::TEMPORARY_ALLOCATION);
this->printKernelsPrintfOutput(false);
}
this->cmdListCurrentStartOffset = commandStream->getUsed();
this->containsAnyKernel = false;
this->handlePostSubmissionState();
if (NEO::DebugManager.flags.PauseOnEnqueue.get() != -1) {
@@ -740,4 +741,12 @@ void CommandListCoreFamilyImmediate<gfxCoreFamily>::checkWaitEventsState(uint32_
}
}
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandListCoreFamilyImmediate<gfxCoreFamily>::printKernelsPrintfOutput(bool hangDetected) {
size_t size = this->printfKernelContainer.size();
for (size_t i = 0; i < size; i++) {
this->printfKernelContainer[i]->printPrintfOutput(hangDetected);
}
}
} // namespace L0