Prepare mechanism for returning GPU execution error on OCL API

translate task count value to OCL error

Related-To: NEO-7412
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-11-04 13:57:42 +00:00
committed by Compute-Runtime-Automation
parent ab6af4247e
commit 1c3d5c3892
22 changed files with 71 additions and 53 deletions

View File

@@ -258,14 +258,12 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
commandQueue.clearLastBcsPackets();
}
bool isGpuHangDetected{false};
if (kernelOperation->blitPropertiesContainer.size() > 0) {
const auto newTaskCount = bcsCsrForAuxTranslation->flushBcsTask(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
if (newTaskCount) {
commandQueue.updateBcsTaskCount(bcsCsrForAuxTranslation->getOsContext().getEngineType(), *newTaskCount);
if (newTaskCount <= CompletionStamp::notReady) {
commandQueue.updateBcsTaskCount(bcsCsrForAuxTranslation->getOsContext().getEngineType(), newTaskCount);
} else {
isGpuHangDetected = true;
completionStamp.taskCount = newTaskCount;
}
}
commandQueue.updateLatestSentEnqueueType(EnqueueProperties::Operation::GpuKernel);
@@ -277,11 +275,11 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
if (printfHandler) {
const auto waitStatus = commandQueue.waitUntilComplete(completionStamp.taskCount, {}, completionStamp.flushStamp, false);
if (waitStatus == WaitStatus::GpuHang) {
isGpuHangDetected = true;
completionStamp.taskCount = CompletionStamp::gpuHang;
}
if (!printfHandler->printEnqueueOutput()) {
isGpuHangDetected = true;
completionStamp.taskCount = CompletionStamp::gpuHang;
}
}
@@ -290,14 +288,10 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
}
surfaces.clear();
if (isGpuHangDetected) {
completionStamp.taskCount = CompletionStamp::gpuHang;
}
return completionStamp;
}
bool CommandWithoutKernel::dispatchBlitOperation() {
uint32_t CommandWithoutKernel::dispatchBlitOperation() {
auto bcsCsr = kernelOperation->bcsCsr;
UNRECOVERABLE_IF(bcsCsr == nullptr);
@@ -314,14 +308,14 @@ bool CommandWithoutKernel::dispatchBlitOperation() {
}
const auto newTaskCount = bcsCsr->flushBcsTask(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
if (!newTaskCount) {
return false;
if (newTaskCount > CompletionStamp::notReady) {
return newTaskCount;
}
commandQueue.updateBcsTaskCount(bcsCsr->getOsContext().getEngineType(), *newTaskCount);
commandQueue.updateBcsTaskCount(bcsCsr->getOsContext().getEngineType(), newTaskCount);
commandQueue.setLastBcsPacket(bcsCsr->getOsContext().getEngineType());
return true;
return newTaskCount;
}
CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminated) {
@@ -420,8 +414,9 @@ CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminate
}
if (kernelOperation->blitEnqueue) {
if (!dispatchBlitOperation()) {
completionStamp.taskCount = CompletionStamp::gpuHang;
auto taskCount = dispatchBlitOperation();
if (taskCount > CompletionStamp::notReady) {
completionStamp.taskCount = taskCount;
}
}

View File

@@ -156,6 +156,6 @@ class CommandWithoutKernel : public Command {
public:
using Command::Command;
CompletionStamp &submit(uint32_t taskLevel, bool terminated) override;
bool dispatchBlitOperation();
uint32_t dispatchBlitOperation();
};
} // namespace NEO