Refactor: Common helper for Blit and CPU memory transfers

Change-Id: Icc61f82517e75e3066e441494af3bf9a7ffbbeef
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-10-09 11:52:00 +02:00
committed by sys_ocldev
parent 33ce6910c5
commit 27f9a95af2
10 changed files with 51 additions and 53 deletions

View File

@@ -433,14 +433,9 @@ bool KernelInfo::createKernelAllocation(const Device &device) {
auto &hwInfo = device.getHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
bool status = false;
if (kernelAllocation->isAllocatedInLocalMemoryPool() && hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo)) {
status = (BlitHelperFunctions::blitMemoryToAllocation(device, kernelAllocation, 0, heapInfo.pKernelHeap, {kernelIsaSize, 1, 1}) == BlitOperationResult::Success);
} else {
status = device.getMemoryManager()->copyMemoryToAllocation(kernelAllocation, 0, heapInfo.pKernelHeap, kernelIsaSize);
}
return status;
return MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelAllocation),
device, kernelAllocation, 0, heapInfo.pKernelHeap,
static_cast<size_t>(kernelIsaSize));
}
void KernelInfo::apply(const DeviceInfoKernelPayloadConstants &constants) {