From c877be2afe326f9e08d99f7b272bbfc24c12efae Mon Sep 17 00:00:00 2001 From: "Xie, AlexBin" <54727243+AlexXAmd@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:19:33 -0500 Subject: [PATCH] rocr: make sure the member variable is conctructed (#1387) Signed-off-by: Alex Xie --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index a80d17af16..08842cb75e 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -496,6 +496,9 @@ void GpuAgent::InitScratchPool() { if (!core::Runtime::runtime_singleton_->flag().enable_scratch()) { scratch_pool_. ~SmallHeap(); + + // Reconstruct the object as default to allow ~GpuAgent to destruct the member variable + new (&scratch_pool_) SmallHeap(); return; }