SWDEV-548417 - Fix Memleaks in Graph (#713)

Co-authored-by: Anusha GodavarthySurya <Anusha.GodavarthySurya@amd.com>
This commit is contained in:
Godavarthy Surya, Anusha
2025-09-19 17:39:36 +05:30
committed by GitHub
parent 9f5b390db4
commit ce560304a8
21 changed files with 78 additions and 60 deletions
+10 -12
View File
@@ -208,20 +208,18 @@ void HostQueue::finish(bool cpu_wait) {
"await command completion",
minBatchSize);
command->awaitCompletion();
if (IS_HIP) {
ScopedLock sl(vdev()->execution());
ScopedLock l(lastCmdLock_);
// Runtime can clear the last command only if no other submissions occured
// during finish()
if (command == lastEnqueueCommand_) {
device_.removeFromActiveQueues(this);
lastEnqueueCommand_->release();
lastEnqueueCommand_ = nullptr;
}
}
if (IS_HIP) {
ScopedLock sl(vdev()->execution());
ScopedLock l(lastCmdLock_);
// Runtime can clear the last command only if no other submissions occured
// during finish()
if (command == lastEnqueueCommand_) {
device_.removeFromActiveQueues(this);
lastEnqueueCommand_->release();
lastEnqueueCommand_ = nullptr;
}
}
// Release all HW queues, which are idle or nearly idle
vdev()->ReleaseAllHwQueues();