P4 to Git Change 1562960 by skudchad@skudchad_test2_win_opencl on 2018/06/01 14:46:26

SWDEV-145570 - [HIP] - Rename SVManager to be more genric. The same functionality can be used for HIP without needing additonal map

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/15054/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#83 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#220 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#306 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#591 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#419 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#92 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#104 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#87 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#53 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.cpp#29 edit


[ROCm/clr commit: 4214c42b59]
This commit is contained in:
foreman
2018-06-01 14:57:43 -04:00
parent bb8c5fc084
commit 918b871a2c
9 changed files with 41 additions and 42 deletions
@@ -1526,7 +1526,7 @@ void* Device::svmAlloc(amd::Context& context, size_t size, size_t alignment, cl_
}
// add the information to context so that we can use it later.
amd::SvmManager::AddSvmBuffer(ptr, mem);
amd::MemObjMap::AddMemObj(ptr, mem);
return ptr;
} else {
@@ -1535,7 +1535,7 @@ void* Device::svmAlloc(amd::Context& context, size_t size, size_t alignment, cl_
} else {
// Copy paste from ORCA code.
// Find the existing amd::mem object
mem = amd::SvmManager::FindSvmBuffer(svmPtr);
mem = amd::MemObjMap::FindMemObj(svmPtr);
if (nullptr == mem) {
return nullptr;
@@ -1547,10 +1547,10 @@ void* Device::svmAlloc(amd::Context& context, size_t size, size_t alignment, cl_
void Device::svmFree(void* ptr) const {
amd::Memory* svmMem = nullptr;
svmMem = amd::SvmManager::FindSvmBuffer(ptr);
svmMem = amd::MemObjMap::FindMemObj(ptr);
if (nullptr != svmMem) {
svmMem->release();
amd::SvmManager::RemoveSvmBuffer(ptr);
amd::MemObjMap::RemoveMemObj(ptr);
hostFree(ptr);
}
}