P4 to Git Change 1373431 by gandryey@gera-w8 on 2017/02/14 17:31:04

SWDEV-112401 - [OCLonROCm vs LinuxPro][Fiji][Perf] Around ~ 70% performance drop observed with OCL SDK - BlackScholes test
	- Switch persistent emulation to device memory instead of system memory, since ROCr doesn't support visible heap without large bar. It's a potential tradeoff of persistent usage in the applications between an upload buffer or directly in a kernel.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#11 edit


[ROCm/clr commit: faf83743d8]
This commit is contained in:
foreman
2017-02-14 17:38:43 -05:00
parent 346ddde28b
commit f5cd5f9de8
@@ -351,8 +351,7 @@ Buffer::create()
// Allocate backing storage in device local memory unless UHP or AHP are set
const cl_mem_flags memFlags = owner()->getMemFlags();
if (!(memFlags & (CL_MEM_USE_HOST_PTR |
CL_MEM_ALLOC_HOST_PTR | CL_MEM_USE_PERSISTENT_MEM_AMD))) {
if (!(memFlags & (CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR))) {
deviceMemory_ = dev_.deviceLocalAlloc(size());
if (deviceMemory_ == NULL) {
@@ -407,17 +406,6 @@ Buffer::create()
return deviceMemory_ != NULL;
}
else if (memFlags & CL_MEM_USE_PERSISTENT_MEM_AMD) {
deviceMemory_ = dev_.hostAlloc(size(), 1, false);
if (deviceMemory_ != nullptr) {
if (owner()->getHostMem() != nullptr) {
memcpy(deviceMemory_, owner()->getHostMem(), size());
}
flags_ |= HostMemoryDirectAccess;
}
return deviceMemory_ != nullptr;
}
assert(owner()->getHostMem() != NULL);
flags_ |= HostMemoryDirectAccess;