P4 to Git Change 1345883 by gandryey@gera-w8 on 2016/11/24 17:31:06

SWDEV-102801 - OpenCL on PAL - mGPU SVM support
	- Update SVM path to use existent cache coherency logic for MGPU

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#80 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#560 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#130 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#409 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#38 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#39 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#123 edit
This commit is contained in:
foreman
2016-11-24 17:43:45 -05:00
parent e4dc501e91
commit afeda63f68
8 changed files with 184 additions and 52 deletions
+14 -1
View File
@@ -1405,10 +1405,23 @@ Device::createBuffer(
return NULL;
}
if (nullptr != owner.parent()->getSvmPtr()) {
amd::Memory* amdParent = owner.parent();
{
// Lock memory object, so only one commitment will occur
amd::ScopedLock lock(amdParent->lockMemoryOps());
amdParent->commitSvmMemory();
amdParent->setHostMem(amdParent->getSvmPtr());
}
// Ignore a possible pinning error. Runtime will fallback to SW emulation
//bool ok = gpuParent->pinSystemMemory(
// amdParent->getHostMem(), amdParent->getSize());
}
return gpuParent->createBufferView(owner);
}
Resource::MemoryType type = (owner.forceSysMemAlloc() || (owner.getMemFlags() & CL_MEM_SVM_FINE_GRAIN_BUFFER)) ?
Resource::MemoryType type = (owner.forceSysMemAlloc() ||
(owner.getMemFlags() & CL_MEM_SVM_FINE_GRAIN_BUFFER)) ?
Resource::Remote : Resource::Local;
if (owner.getMemFlags() & CL_MEM_BUS_ADDRESSABLE_AMD) {