Pick main Kernel for PrintfHandler and AubSubCapture

Change-Id: I9ff3bdaa5da82e162642deeaf4a8e0821ff00da2
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2018-08-17 15:13:04 +02:00
committed by sys_ocldev
parent 64dbdf1556
commit 56562963ef
4 changed files with 66 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ PrintfHandler::~PrintfHandler() {
PrintfHandler *PrintfHandler::create(const MultiDispatchInfo &multiDispatchInfo, Device &device) {
if (multiDispatchInfo.usesStatelessPrintfSurface() ||
(multiDispatchInfo.begin()->getKernel()->checkIfIsParentKernelAndBlocksUsesPrintf())) {
(multiDispatchInfo.peekMainKernel()->checkIfIsParentKernelAndBlocksUsesPrintf())) {
return new PrintfHandler(device);
}
return nullptr;
@@ -51,7 +51,7 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo)
if (printfSurfaceSize == 0) {
return;
}
kernel = multiDispatchInfo.begin()->getKernel();
kernel = multiDispatchInfo.peekMainKernel();
printfSurface = device.getMemoryManager()->allocateGraphicsMemoryInPreferredPool(true, nullptr, printfSurfaceSize, GraphicsAllocation::AllocationType::PRINTF_SURFACE);
*reinterpret_cast<uint32_t *>(printfSurface->getUnderlyingBuffer()) = printfSurfaceInitialDataSize;