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
@@ -2102,11 +2102,11 @@ void* Device::svmAlloc(amd::Context& context, size_t size, size_t alignment, cl_
gpu::Memory* gpuMem = getGpuMemory(mem);
// add the information to context so that we can use it later.
amd::SvmManager::AddSvmBuffer(mem->getSvmPtr(), mem);
amd::MemObjMap::AddMemObj(mem->getSvmPtr(), mem);
svmPtr = mem->getSvmPtr();
} else {
// find the existing amd::mem object
mem = amd::SvmManager::FindSvmBuffer(svmPtr);
mem = amd::MemObjMap::FindMemObj(svmPtr);
if (NULL == mem) {
return NULL;
}
@@ -2126,15 +2126,14 @@ void Device::svmFree(void* ptr) const {
amd::Os::alignedFree(ptr);
} else {
amd::Memory* svmMem = NULL;
svmMem = amd::SvmManager::FindSvmBuffer(ptr);
svmMem = amd::MemObjMap::FindMemObj(ptr);
if (NULL != svmMem) {
svmMem->release();
amd::SvmManager::RemoveSvmBuffer(ptr);
amd::MemObjMap::RemoveMemObj(ptr);
}
}
}
Device::SrdManager::~SrdManager() {
for (uint i = 0; i < pool_.size(); ++i) {
pool_[i].buf_->unmap(NULL);