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); };