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

@@ -56,12 +56,8 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc
auto &hwInfo = device.getHardwareInfo();
auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
bool success = false;
if (gpuAllocation->isAllocatedInLocalMemoryPool() && helper.isBlitCopyRequiredForLocalMemory(hwInfo)) {
success = (BlitHelperFunctions::blitMemoryToAllocation(device, gpuAllocation, 0, initData, {size, 1, 1}) == BlitOperationResult::Success);
} else {
success = device.getMemoryManager()->copyMemoryToAllocation(gpuAllocation, 0, initData, static_cast<uint32_t>(size));
}
auto success = MemoryTransferHelper::transferMemoryToAllocation(helper.isBlitCopyRequiredForLocalMemory(hwInfo, *gpuAllocation),
device, gpuAllocation, 0, initData, size);
UNRECOVERABLE_IF(!success);