From 892a21709319cc5a583a0bd743102a05869a0775 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 17 Apr 2017 16:22:14 -0500 Subject: [PATCH] P4 to Git Change 1399165 by cpaquot@cpaquot-rcf-lnx on 2017/04/17 17:11:18 SWDEV-118110 - Need to propagate host mem value in createView Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#16 edit --- rocclr/runtime/device/rocm/rocmemory.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rocclr/runtime/device/rocm/rocmemory.cpp b/rocclr/runtime/device/rocm/rocmemory.cpp index 78dce676a6..ae7d45eb02 100644 --- a/rocclr/runtime/device/rocm/rocmemory.cpp +++ b/rocclr/runtime/device/rocm/rocmemory.cpp @@ -972,6 +972,15 @@ bool Image::createView(const Memory& parent) { return false; } + // Explicitly set the host memory location, + // because the parent location could change after reallocation + if (nullptr != parent.owner()->getHostMem()) { + owner()->setHostMem(reinterpret_cast(parent.owner()->getHostMem()) + owner()->getOrigin()); + } + else { + owner()->setHostMem(nullptr); + } + return true; }