Account for offset pointer in P2P memory copies
Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:
parent
033b16fa43
commit
f5210ed89f
|
@ -1752,8 +1752,12 @@ inline AlignedAllocationData CommandListCoreFamily<gfxCoreFamily>::getAlignedAll
|
|||
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
|
||||
DriverHandleImp *driverHandle = static_cast<DriverHandleImp *>(deviceImp->getDriverHandle());
|
||||
if (driverHandle->isRemoteResourceNeeded(const_cast<void *>(buffer), alloc, allocData, device)) {
|
||||
uint64_t pbase = allocData->gpuAllocations.getDefaultGraphicsAllocation()->getGpuAddress();
|
||||
uint64_t offset = sourcePtr - pbase;
|
||||
|
||||
alloc = driverHandle->getPeerAllocation(device, allocData, const_cast<void *>(buffer), &alignedPtr);
|
||||
UNRECOVERABLE_IF(alloc == nullptr);
|
||||
alignedPtr += offset;
|
||||
} else {
|
||||
alignedPtr = sourcePtr;
|
||||
}
|
||||
|
|
|
@ -620,10 +620,14 @@ ze_result_t KernelImp::setArgBuffer(uint32_t argIndex, size_t argSize, const voi
|
|||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
uint64_t pbase = allocData->gpuAllocations.getDefaultGraphicsAllocation()->getGpuAddress();
|
||||
uint64_t offset = (uint64_t)requestedAddress - pbase;
|
||||
|
||||
alloc = driverHandle->getPeerAllocation(device, allocData, requestedAddress, &gpuAddress);
|
||||
if (alloc == nullptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
gpuAddress += offset;
|
||||
}
|
||||
|
||||
return setArgBufferWithAlloc(argIndex, gpuAddress, alloc);
|
||||
|
|
Loading…
Reference in New Issue