From 16fcf72c4277cf0a0df131671be4a653ce6ee051 Mon Sep 17 00:00:00 2001 From: Sarbojit Sarkar Date: Tue, 16 Mar 2021 04:41:29 -0700 Subject: [PATCH] SWDEV-271539 - fix for hipMemcpy3D segfault Change-Id: I9c76dfaa19fb3a848623ddf3297a6c8a38f7c494 --- rocclr/platform/memory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rocclr/platform/memory.cpp b/rocclr/platform/memory.cpp index 1e2f6e4a85..855bd65d58 100644 --- a/rocclr/platform/memory.cpp +++ b/rocclr/platform/memory.cpp @@ -1179,10 +1179,9 @@ Image* Image::createView(const Context& context, const Format& format, device::V if ((context.devices().size() == 1) || DISABLE_DEFERRED_ALLOC) { for (uint i = 0; i < numDevices_; ++i) { // Make sure the parent's device memory is avaialbe - if ((deviceMemories_[i].ref_ == context.devices()[i]) && + if ((deviceMemories_[i].ref_ != nullptr) && (deviceMemories_[i].value_ != nullptr)) { - device::Memory* mem = view->getDeviceMemory(*context.devices()[i]); - break; + device::Memory* mem = view->getDeviceMemory(*(deviceMemories_[i].ref_)); } } }