P4 to Git Change 1119692 by xcui@merged_opencl_jxcwin on 2015/02/06 16:20:16
EPR #413091 - created backing store in the maptarget and move the commit SVM memory funciton into alloMaptarget function. Added sync funtion in map so that it can handle mGPU cases. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#116 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#205 edit
This commit is contained in:
@@ -923,6 +923,22 @@ Memory::allocMapTarget(
|
||||
size_t offset = origin[0];
|
||||
|
||||
incIndMapCount();
|
||||
void *initHostPtr = NULL;
|
||||
bool failed = false;
|
||||
|
||||
if (!owner()->getSvmPtr()) {
|
||||
initHostPtr = owner()->getHostMem();
|
||||
static const bool forceAllocHostMem = true;
|
||||
if (NULL == initHostPtr) {
|
||||
if (!owner()->allocHostMemory(NULL, forceAllocHostMem)) {
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
owner()->commitSvmMemory();
|
||||
initHostPtr = owner()->getSvmPtr();
|
||||
}
|
||||
|
||||
// If host memory exists, use it
|
||||
if ((owner()->getHostMem() != NULL) && isDirectMap()) {
|
||||
@@ -954,7 +970,7 @@ Memory::allocMapTarget(
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user