Add pointer checks

Change-Id: I37a6898670a4d9e66f0eff404b5282714f293956
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2019-11-29 17:34:18 +01:00
committed by sys_ocldev
parent 04b4198228
commit 0270ad8015
5 changed files with 21 additions and 2 deletions

View File

@@ -25,8 +25,12 @@ PrintfHandler::~PrintfHandler() {
}
PrintfHandler *PrintfHandler::create(const MultiDispatchInfo &multiDispatchInfo, Device &device) {
if (multiDispatchInfo.usesStatelessPrintfSurface() ||
(multiDispatchInfo.peekMainKernel()->checkIfIsParentKernelAndBlocksUsesPrintf())) {
if (multiDispatchInfo.usesStatelessPrintfSurface()) {
return new PrintfHandler(device);
}
auto mainKernel = multiDispatchInfo.peekMainKernel();
if ((mainKernel != nullptr) &&
mainKernel->checkIfIsParentKernelAndBlocksUsesPrintf()) {
return new PrintfHandler(device);
}
return nullptr;