From eb3d45d3006880509bc80605ed3c242fa645784a Mon Sep 17 00:00:00 2001 From: Yiannis Papadopoulos Date: Fri, 18 Jul 2025 15:49:18 -0400 Subject: [PATCH] rocr: Fix warnings --- runtime/hsa-runtime/core/inc/runtime.h | 5 ----- runtime/hsa-runtime/core/runtime/runtime.cpp | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/runtime/hsa-runtime/core/inc/runtime.h b/runtime/hsa-runtime/core/inc/runtime.h index 0cbc742685..c47a5f2d25 100644 --- a/runtime/hsa-runtime/core/inc/runtime.h +++ b/runtime/hsa-runtime/core/inc/runtime.h @@ -888,11 +888,6 @@ class Runtime { const hsa_amd_memory_access_desc_t *desc, const size_t desc_cnt); - // Frees runtime memory when the runtime library is unloaded if safe to do so. - // Failure to release the runtime indicates an incorrect application but is - // common (example: calls library routines at process exit). - friend class RuntimeCleanup; - void InitIPCDmaBufSupport(); bool ipc_dmabuf_supported_; int IPCClientImport(uint32_t conn_handle, uint64_t dmabuf_fd_handle, diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index ff52495d45..c2ee15c922 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -3194,10 +3194,11 @@ hsa_status_t Runtime::VMemoryAddressFree(void* va, size_t size) { if (it->second.use_count > 0) return HSA_STATUS_ERROR_RESOURCE_FREE; - if (it->second.registered) + if (it->second.registered) { if (HSAKMT_CALL(hsaKmtFreeMemory(it->second.os_addr, size)) != HSAKMT_STATUS_SUCCESS) return HSA_STATUS_ERROR; - else + } else { if (munmap(it->second.os_addr, size)) return HSA_STATUS_ERROR; + } reserved_address_map_.erase(it); return HSA_STATUS_SUCCESS;