From a66130bc48d59d5a1fb7eabed75bafd72ab14a56 Mon Sep 17 00:00:00 2001 From: Yiannis Papadopoulos Date: Fri, 14 Feb 2025 17:39:53 -0500 Subject: [PATCH] rocr: Release vmem handles before agent destruction --- runtime/hsa-runtime/core/runtime/runtime.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index 124fc14f5d..5314cc87fd 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2098,12 +2098,6 @@ void Runtime::Unload() { amd::hsa::loader::Loader::Destroy(loader_); loader_ = nullptr; - std::for_each(gpu_agents_.begin(), gpu_agents_.end(), DeleteObject()); - gpu_agents_.clear(); - - std::for_each(disabled_gpu_agents_.begin(), disabled_gpu_agents_.end(), DeleteObject()); - disabled_gpu_agents_.clear(); - asyncSignals_.control.Shutdown(); asyncExceptions_.control.Shutdown(); @@ -2125,6 +2119,9 @@ void Runtime::Unload() { EventPool.clear(); + mapped_handle_map_.clear(); + memory_handle_map_.clear(); + DestroyAgents(); CloseTools();