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
+13 -9
View File
@@ -858,6 +858,8 @@ Memory::allocMapTarget(
if (!owner()->allocHostMemory(NULL, forceAllocHostMem)) {
return NULL;
}
//! \note Ignore pinning result
//bool ok = pinSystemMemory(owner()->getHostMem(), owner()->getSize());
}
}
@@ -965,10 +967,9 @@ Memory::pinSystemMemory(void* hostPtr, size_t size)
return true;
}
// Destroy the old pinned memory if it was already allocated
// Check if memory is pinned already
if (flags_ & PinnedMemoryAlloced) {
delete pinnedMemory_;
flags_ &= ~PinnedMemoryAlloced;
return true;
}
// Allocate memory for the pinned object
@@ -1115,16 +1116,19 @@ Memory::mgpuCacheWriteBack()
// Attempt to allocate a staging buffer if don't have any
if (owner()->getHostMem() == NULL) {
static const bool forceAllocHostMem = true;
if (owner()->allocHostMemory(NULL, forceAllocHostMem)) {
//! \note Ignore pinning result
bool ok = pinSystemMemory(
owner()->getHostMem(), owner()->getHostMemRef()->size());
if (nullptr != owner()->getSvmPtr()) {
owner()->commitSvmMemory();
owner()->setHostMem(owner()->getSvmPtr());
}
else {
static const bool forceAllocHostMem = true;
owner()->allocHostMemory(nullptr, forceAllocHostMem);
}
}
// Make synchronization
if (owner()->getHostMem() != NULL) {
//! \note Ignore pinning result
bool ok = pinSystemMemory(owner()->getHostMem(), owner()->getSize());
owner()->cacheWriteBack();
}
}