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


[ROCm/clr commit: 072a375629]
This commit is contained in:
foreman
2015-02-13 17:49:06 -05:00
szülő 2c92d4e2e8
commit d4106ee51e
3 fájl változott, egészen pontosan 19 új sor hozzáadva és 4 régi sor törölve
@@ -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) {