feature: add printf kernel support when executing regular from immediate

Related-To: NEO-10356

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-04-07 22:36:37 +00:00
committed by Compute-Runtime-Automation
parent 1c377dc930
commit 679d3a2be5
2 changed files with 33 additions and 1 deletions

View File

@@ -1181,8 +1181,13 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::hostSynchronize(uint6
}
}
this->printKernelsPrintfOutput(status == ZE_RESULT_ERROR_DEVICE_LOST);
bool hangDetected = status == ZE_RESULT_ERROR_DEVICE_LOST;
this->printKernelsPrintfOutput(hangDetected);
this->checkAssert();
{
auto cmdQueueImp = static_cast<CommandQueueImp *>(this->cmdQImmediate);
cmdQueueImp->printKernelsPrintfOutput(hangDetected);
}
}
}

View File

@@ -1794,5 +1794,32 @@ HWTEST2_F(ImmediateCommandListTest, givenAsyncCmdlistWhenCmdlistIsDestroyedThenH
EXPECT_EQ(0u, clientCount);
}
HWTEST_F(ImmediateCommandListTest,
givenImmediateCmdListWhenAppendingRegularCmdListWithPrintfKernelThenPrintfIsCalledAfterSynchronization) {
ze_result_t returnValue;
auto kernel = new Mock<KernelImp>{};
kernel->module = module.get();
kernel->descriptor.kernelAttributes.flags.usesPrintf = true;
kernel->createPrintfBuffer();
module->getPrintfKernelContainer().push_back(std::shared_ptr<Kernel>{kernel});
ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
returnValue = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
returnValue = commandList->close();
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
auto commandListHandle = commandList->toHandle();
EXPECT_EQ(0u, kernel->printPrintfOutputCalledTimes);
returnValue = commandListImmediate->appendCommandLists(1, &commandListHandle, nullptr, 0, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
returnValue = commandListImmediate->hostSynchronize(std::numeric_limits<uint64_t>::max());
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
EXPECT_EQ(1u, kernel->printPrintfOutputCalledTimes);
}
} // namespace ult
} // namespace L0