P4 to Git Change 1410373 by gandryey@gera-w8 on 2017/05/16 17:16:52
SWDEV-120180 - [amdgpu-pro] OpenCL support for SSG - Add initial support of DGMA memory under ROCr backend. - The implementation requires amdgpu-pro stack initialization and memory allocation. - An interop with HSA device is created for ROCr access Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/Makefile#10 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#153 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#285 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#351 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/lnxheaders.h#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.cpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodriver.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#11 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#101 edit ... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#41 edit
This commit is contained in:
1 parent
df45033047
commit
0da70b03de
13 files changed
+454
-84
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include "platform/memory.hpp"
|
||||
#include "platform/sampler.hpp"
|
||||
#include "amdocl/cl_gl_amd.hpp"
|
||||
#include "pro/prodriver.hpp"
|
||||
|
||||
namespace roc {
|
||||
|
||||
@@ -548,7 +549,12 @@ void Buffer::destroy() {
|
||||
}
|
||||
|
||||
const cl_mem_flags memFlags = owner()->getMemFlags();
|
||||
|
||||
#ifdef WITH_AMDGPU_PRO
|
||||
if ((memFlags & CL_MEM_USE_PERSISTENT_MEM_AMD) && dev().ProEna()) {
|
||||
dev().iPro().FreeDmaBuffer(deviceMemory_);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((deviceMemory_ != nullptr) && (deviceMemory_ != owner()->getHostMem())) {
|
||||
// if they are identical, the host pointer will be
|
||||
// deallocated later on => avoid double deallocation
|
||||
@@ -611,6 +617,20 @@ bool Buffer::create() {
|
||||
|
||||
// Allocate backing storage in device local memory unless UHP or AHP are set
|
||||
const cl_mem_flags memFlags = owner()->getMemFlags();
|
||||
|
||||
#ifdef WITH_AMDGPU_PRO
|
||||
if ((memFlags & CL_MEM_USE_PERSISTENT_MEM_AMD) && dev().ProEna()) {
|
||||
void* host_ptr = nullptr;
|
||||
deviceMemory_ = dev().iPro().AllocDmaBuffer(dev().getGpuAgents()[0], size(), &host_ptr);
|
||||
if (deviceMemory_ == nullptr) {
|
||||
return false;
|
||||
}
|
||||
flags_ |= HostMemoryDirectAccess;
|
||||
owner()->setHostMem(host_ptr);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(memFlags & (CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR))) {
|
||||
deviceMemory_ = dev().deviceLocalAlloc(size());
|
||||
|
||||
|
||||
Reference in new issue
Block a user