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

@@ -110,18 +110,9 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, NEO::MemoryMan
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (kernelInfo->heapInfo.pKernelHeap != nullptr) {
bool doCpuIsaCopy = true;
if (allocation->isAllocatedInLocalMemoryPool() && hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo)) {
auto status = NEO::BlitHelperFunctions::blitMemoryToAllocation(*device, allocation, 0, kernelInfo->heapInfo.pKernelHeap, {kernelIsaSize, 1, 1});
UNRECOVERABLE_IF(status == NEO::BlitOperationResult::Fail);
doCpuIsaCopy = (status == NEO::BlitOperationResult::Unsupported);
}
if (doCpuIsaCopy) {
memoryManager.copyMemoryToAllocation(allocation, 0, kernelInfo->heapInfo.pKernelHeap, kernelIsaSize);
}
NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *allocation),
*device, allocation, 0, kernelInfo->heapInfo.pKernelHeap,
static_cast<size_t>(kernelIsaSize));
}
isaGraphicsAllocation.reset(allocation);