From fb8ab442b68cb3715c5580caab8e03bb383237fd Mon Sep 17 00:00:00 2001 From: cfreeamd <166262151+cfreeamd@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:20:53 -0500 Subject: [PATCH] rocr: Don't assert in hsa_shut_down when no agents (#1115) * rocr: Don't assert in hsa_shut_down when no agents Instead, print error message and return an error. Prior to this patch, the assertion would occur when hsa_shut_down() is called more than once. * rocr: Reorder Unload ASAN clean-up on shut down --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 d32b5a450a..e4b923ac21 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2256,12 +2256,12 @@ void Runtime::Unload() { mapped_handle_map_.clear(); memory_handle_map_.clear(); - DestroyAgents(); - CloseTools(); AMD::Unload(); + DestroyAgents(); + DestroyDrivers(); thunkLoader_->DestroyThunkInstance();