From 588e124c4ec6e946967f4f2728bb9b8ad99e144d Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Tue, 19 Apr 2022 22:13:55 -0500 Subject: [PATCH] Ensure IPC imports always create an allocation map entry. Simplifies behavior. A memory type now either always generates an entry or never does. Change-Id: Ie98cddea01e801308ac0ba650795fdef92b7e47d [ROCm/ROCR-Runtime commit: 0ba9b162dbd6eaed899094ab4c3c7138ec6e8f63] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 390ec665b7..9aea1021f9 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -947,9 +947,10 @@ hsa_status_t Runtime::IPCAttach(const hsa_amd_ipc_memory_t* handle, size_t len, uint32_t fragOffset = 0; auto fixFragment = [&]() { - if (!isFragment) return; - importAddress = reinterpret_cast(importAddress) + fragOffset; - len = Min(len, importSize - fragOffset); + if (isFragment) { + importAddress = reinterpret_cast(importAddress) + fragOffset; + len = Min(len, importSize - fragOffset); + } ScopedAcquire lock(&memory_lock_); allocation_map_[importAddress] = AllocationRegion(nullptr, len); };