From 229a8862dc735fd3c97488ec3ca380ec36484817 Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 11 Aug 2016 20:19:39 -0400 Subject: [PATCH] P4 to Git Change 1302288 by cpaquot@hog-ocl on 2016/08/11 19:32:24 SWDEV-100298 - oclPerfImageMapUnmap test fails in Fiji Reverted back CL #1295719 and instead copy back the whole host mem data onto the device memory since that's what is done at map time. ReviewBoardURL = http://ocltc.amd.com/reviews/r/11076/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#7 edit [ROCm/clr commit: 4bc132bc874d1921aecd492c0e09dc55098d01b9] --- .../clr/rocclr/runtime/device/rocm/rocvirtual.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp index 73ad22461c..9a23d44f3c 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp @@ -1208,16 +1208,20 @@ void VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand &cmd) } if (mapInfo->isUnmapWrite()) { // Commit the changes made by the user. - if (devMemory->owner()->getHostMem() == nullptr) { + if (!devMemory->isHostMemDirectAccess()) { bool result = false; if (cmd.memory().asImage() && !imageBuffer) { amd::Image *image = cmd.memory().asImage(); + amd::Memory* mapMemory = devMemory->mapMemory(); + void *hostPtr = mapMemory == NULL ? + devMemory->owner()->getHostMem() : + mapMemory->getHostMem(); + result = blitMgr().writeImage( - cmd.mapPtr(), *devMemory, - mapInfo->origin_, - mapInfo->region_, - image->getRowPitch(), image->getSlicePitch()); + hostPtr, *devMemory, + amd::Coord3D(0), image->getRegion(), + image->getRowPitch(), image->getSlicePitch(), true); } else { amd::Coord3D origin(mapInfo->origin_[0]);