Add MultiGraphicsAllocation to USM

Related-To: NEO-4672
Change-Id: I53ea4bea73ae6d52840146f63bc561bb90f9fe62
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-06-29 12:47:13 +02:00
committed by sys_ocldev
parent 5bc511b77d
commit 93c1e1b976
33 changed files with 306 additions and 237 deletions

View File

@@ -39,9 +39,10 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
//check if we are dealing with SVM pointer here for which we already have an allocation
if (!mapAllocation && this->getContext().getSVMAllocsManager()) {
auto rootDeviceIndex = getDevice().getRootDeviceIndex();
auto svmEntry = this->getContext().getSVMAllocsManager()->getSVMAlloc(ptr);
if (svmEntry) {
if ((svmEntry->gpuAllocation->getGpuAddress() + svmEntry->size) < (castToUint64(ptr) + size)) {
if ((svmEntry->gpuAllocations.getGraphicsAllocation(rootDeviceIndex)->getGpuAddress() + svmEntry->size) < (castToUint64(ptr) + size)) {
return CL_INVALID_OPERATION;
}
@@ -51,7 +52,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
}
}
mapAllocation = svmEntry->cpuAllocation ? svmEntry->cpuAllocation : svmEntry->gpuAllocation;
mapAllocation = svmEntry->cpuAllocation ? svmEntry->cpuAllocation : svmEntry->gpuAllocations.getGraphicsAllocation(rootDeviceIndex);
}
}