P4 to Git Change 1464512 by gandryey@gera-w8 on 2017/09/28 12:57:40

SWDEV-133851 - [CQE OCL][1.2][LNX-PRO] A subtest from OCLcompiler is failing due to faulty cl#1458879
	- If pinning failed and allocation was forced to system memory, then copy the original data

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#577 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#64 edit


[ROCm/clr commit: af98be0351]
This commit is contained in:
foreman
2017-09-28 13:03:15 -04:00
parent e8ec5c989c
commit 083efcd692
2 changed files with 4 additions and 2 deletions
@@ -1436,7 +1436,8 @@ gpu::Memory* Device::createBuffer(amd::Memory& owner, bool directAccess) const {
void* address = gpuMemory->map(NULL);
if (address != NULL) {
// Copy saved memory
if (owner.getMemFlags() & CL_MEM_COPY_HOST_PTR) {
// Note: UHP is an optional check if pinning failed and sysmem alloc was forced
if (owner.getMemFlags() & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) {
memcpy(address, owner.getHostMem(), owner.getSize());
}
// It should be safe to change the host memory pointer,
@@ -1342,7 +1342,8 @@ pal::Memory* Device::createBuffer(amd::Memory& owner, bool directAccess) const {
void* address = gpuMemory->map(nullptr);
if (address != nullptr) {
// Copy saved memory
if (owner.getMemFlags() & CL_MEM_COPY_HOST_PTR) {
// Note: UHP is an optional check if pinning failed and sysmem alloc was forced
if (owner.getMemFlags() & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) {
memcpy(address, owner.getHostMem(), owner.getSize());
}
// It should be safe to change the host memory pointer,