Store crossThreadData per root device in Kernel

Related-To: NEO-5001
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-11-18 18:39:32 +00:00
committed by Compute-Runtime-Automation
parent 556b6cd457
commit a67e829fa8
39 changed files with 306 additions and 269 deletions

View File

@@ -46,8 +46,9 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo)
if (printfSurfaceSize == 0) {
return;
}
auto rootDeviceIndex = device.getRootDeviceIndex();
kernel = multiDispatchInfo.peekMainKernel();
printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({device.getRootDeviceIndex(), printfSurfaceSize, GraphicsAllocation::AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()});
printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, GraphicsAllocation::AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()});
auto &hwInfo = device.getHardwareInfo();
auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
@@ -56,7 +57,7 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo)
device.getDevice(), printfSurface, 0, &printfSurfaceInitialDataSize,
sizeof(printfSurfaceInitialDataSize));
auto printfPatchAddress = ptrOffset(reinterpret_cast<uintptr_t *>(kernel->getCrossThreadData()),
auto printfPatchAddress = ptrOffset(reinterpret_cast<uintptr_t *>(kernel->getCrossThreadData(rootDeviceIndex)),
kernel->getKernelInfo().patchInfo.pAllocateStatelessPrintfSurface->DataParamOffset);
patchWithRequiredSize(printfPatchAddress, kernel->getKernelInfo().patchInfo.pAllocateStatelessPrintfSurface->DataParamSize, (uintptr_t)printfSurface->getGpuAddressToPatch());