From 74ccf71d53fdaa42d43ebb8441f9dfd3e0e3d1e3 Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Fri, 16 Jul 2021 16:11:41 -0400 Subject: [PATCH] SWDEV-294514 - Limit HIP-GL interop logic to HIP Below logic is causing a crash in the CL-GL interop. As a workaround, limit it only to HIP. Change-Id: I12e81d035ebd80a4a9a09eb6eea2fae7040d90c9 --- rocclr/platform/memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocclr/platform/memory.cpp b/rocclr/platform/memory.cpp index 20eef2bbfa..0ebe458f83 100644 --- a/rocclr/platform/memory.cpp +++ b/rocclr/platform/memory.cpp @@ -301,7 +301,7 @@ bool Memory::create(void* initFrom, bool sysMemAlloc, bool skipAlloc, bool force LogPrintfError("Can't allocate memory size - 0x%08X bytes!", getSize()); return false; } - if (isInterop()) { + if (amd::IS_HIP && isInterop()) { // Interop resources dont' have svm allocations, we use device address for mapping. amd::MemObjMap::AddMemObj( reinterpret_cast(static_cast(mem->virtualAddress())), this); @@ -415,7 +415,7 @@ Memory::~Memory() { if (NULL != deviceMemories_) { // Destroy all device memory objects for (uint i = 0; i < numDevices_; ++i) { - if (isInterop() && deviceMemories_[i].value_ != nullptr) { + if (amd::IS_HIP && isInterop() && deviceMemories_[i].value_ != nullptr) { amd::MemObjMap::RemoveMemObj(reinterpret_cast( static_cast(deviceMemories_[i].value_->virtualAddress()))); }