From 9fda38f0bacc3b80b176ff1b2fcf2a73e44c2639 Mon Sep 17 00:00:00 2001 From: Shweta Khatri Date: Wed, 12 Jul 2023 15:27:43 -0400 Subject: [PATCH] Fixes a bug that led to setting wrong access type for device local memory The access type for extended scope fine grained memory was being returned as never allowed by default Change-Id: I0167ea0e5931053f22f2d2755bf426d43d2bb8e5 [ROCm/ROCR-Runtime commit: 82e7979c61aac031c8f3a10b5f52806ee1eef46c] --- .../hsa-runtime/core/runtime/amd_memory_region.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp index bd87b9c5bd..2218dfc9f6 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp @@ -495,21 +495,16 @@ hsa_amd_memory_pool_access_t MemoryRegion::GetAccessInfo( // Determine access type for device local memory which is // guaranteed to be HSA_HEAPTYPE_FRAME_BUFFER_PUBLIC - // Return disallowed by default if framebuffer is coarse grained - // without regard to type of requesting device (CPU / GPU) - // Return disallowed by default if framebuffer is fine grained - // and requesting device is connected via xGMI link if (IsLocalMemory()) { - // Return disallowed by default if memory is coarse - // grained without regard to link type - if (extended_scope_fine_grain() == false && fine_grain() == false) { + // grained or extended scope fine grained without regard to link type + if (fine_grain() == false) { return HSA_AMD_MEMORY_POOL_ACCESS_DISALLOWED_BY_DEFAULT; } // Return disallowed by default if memory is fine - // grained and link type is xGMI. + // grained and requesting device is connected via xGMI link if (agent.HiveId() == owner()->HiveId()) { return HSA_AMD_MEMORY_POOL_ACCESS_DISALLOWED_BY_DEFAULT; }