From 6ae5d6896cd10bf287afb6ed68fc2cbdde247cd5 Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Thu, 18 Jul 2024 10:58:08 +0000 Subject: [PATCH] SWDEV-468424 - Fix kernelArg mgr release and clear commands after capture Creation of ReferenceCountedObject will increase reference count by 1. Clear the commands from Node after capture so that they wont be reference later. Change-Id: I1cc4085939cf65218ec2aa2e25ab6d737f7cacd3 --- hipamd/src/hip_graph_internal.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_graph_internal.hpp b/hipamd/src/hip_graph_internal.hpp index 171bfb24da..eee2c45811 100644 --- a/hipamd/src/hip_graph_internal.hpp +++ b/hipamd/src/hip_graph_internal.hpp @@ -252,6 +252,8 @@ struct GraphNode : public hipGraphNodeDOTAttribute { command->submit(*(command->queue())->vdev()); command->release(); } + // Commands are captured and released. Clear them from the object. + commands_.clear(); } hip::Stream* GetQueue() const { return stream_; } @@ -704,7 +706,6 @@ struct GraphExec : public amd::ReferenceCountedObject { // child graph nodes and each child graph has only one node. void SetKernelArgManager(GraphKernelArgManager* kernArgManager) { kernArgManager_ = kernArgManager; - kernArgManager_->retain(); } GraphKernelArgManager* GetKernelArgManager() { return kernArgManager_;