From 56ba584a2220087abd5a0e46b695ee22d54fe938 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 19 Aug 2024 17:28:26 +0000 Subject: [PATCH] rocr: Delete internal CP queues in GPU agent destructor Delete queues used internally in agent destructor to make sure any memory allocated by the queue objects are freed before the agent memory regions are destroyed. Change-Id: I4768c9cf66f77ac00a5a355f373f7f22dc266e47 --- runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 32b8ac9e8f..46a7af0b11 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -234,6 +234,9 @@ GpuAgent::~GpuAgent() { hsaKmtFreeMemory(scratch_pool_.base(), scratch_pool_.size()); } + for (int i = 0; i < QueueCount; i++) + queues_[i].reset(); + system_deallocator()(doorbell_queue_map_); if (trap_code_buf_ != NULL) {