fix: disable locked ptr memcpy for imported BOs

Related-To: GSD-6300

Signed-off-by: Lu, Wenbin <wenbin.lu@intel.com>
This commit is contained in:
Lu, Wenbin
2023-10-02 17:46:48 +00:00
committed by Compute-Runtime-Automation
parent 1054d166e2
commit e996241063
3 changed files with 59 additions and 0 deletions

View File

@@ -947,6 +947,11 @@ bool CommandListCoreFamilyImmediate<gfxCoreFamily>::preferCopyThroughLockedPtr(C
return false;
}
if (((cpuMemCopyInfo.srcAllocData != nullptr) && (cpuMemCopyInfo.srcAllocData->isImportedAllocation)) ||
((cpuMemCopyInfo.dstAllocData != nullptr) && (cpuMemCopyInfo.dstAllocData->isImportedAllocation))) {
return false;
}
const TransferType transferType = getTransferType(cpuMemCopyInfo.dstAllocData, cpuMemCopyInfo.srcAllocData);
const size_t transferThreshold = getTransferThreshold(transferType);

View File

@@ -676,6 +676,7 @@ void *DriverHandleImp::importFdHandles(NEO::Device *neoDevice, ze_ipc_memory_fla
allocDataTmp->size = alloc->getUnderlyingBufferSize();
allocDataTmp->memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
allocDataTmp->device = neoDevice;
allocDataTmp->isImportedAllocation = true;
allocDataTmp->setAllocId(this->getSvmAllocsManager()->allocationsCounter++);
if (flags & ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED) {
@@ -847,6 +848,7 @@ void *DriverHandleImp::importNTHandle(ze_device_handle_t hDevice, void *handle,
allocData.memoryType =
isHostIpcAllocation ? InternalMemoryType::HOST_UNIFIED_MEMORY : InternalMemoryType::DEVICE_UNIFIED_MEMORY;
allocData.device = neoDevice;
allocData.isImportedAllocation = true;
allocData.setAllocId(this->getSvmAllocsManager()->allocationsCounter++);
this->getSvmAllocsManager()->insertSVMAlloc(allocData);