P4 to Git Change 1122235 by xcui@merged_opencl_jxcwin on 2015/02/13 17:28:52

EPR #413091 - move commit svm host memory into allocmaptarget and added hostmemref as the backing store  for multiple gpu cases

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#73 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#280 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#118 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#115 edit
This commit is contained in:
foreman
2015-02-13 17:49:06 -05:00
parent 96a1e9388f
commit 072a375629
3 changed files with 19 additions and 4 deletions
+15 -3
View File
@@ -922,8 +922,22 @@ Memory::allocMapTarget(
address mapAddress = NULL;
size_t offset = origin[0];
incIndMapCount();
//For SVM implementation, we cannot use cached map. if svm space, use the svm host pointer
void *initHostPtr = owner()->getSvmPtr();
if (NULL != initHostPtr) {
owner()->commitSvmMemory();
}
if (owner()->numDevices() > 1) {
if ((NULL == initHostPtr) && (owner()->getHostMem() == NULL)) {
static const bool forceAllocHostMem = true;
if (!owner()->allocHostMemory(NULL, forceAllocHostMem)) {
return NULL;
}
}
}
incIndMapCount();
// If host memory exists, use it
if ((owner()->getHostMem() != NULL) && isDirectMap()) {
mapAddress = reinterpret_cast<address>(owner()->getHostMem());
@@ -953,8 +967,6 @@ Memory::allocMapTarget(
bool failed = false;
amd::Memory* memory = NULL;
// Search for a possible indirect resource
//For SVM implementation, we cannot use cached map. if svm space, use the svm host pointer
void *initHostPtr = owner()->getSvmPtr();
cl_mem_flags flag = 0;
bool canBeCached = true;
if (NULL != initHostPtr) {