SWDEV-240806 - Release resources in Command::terminate for HIP

We do not want to release resources during setStatus in HIP because of Graphs

Change-Id: Idc7b188ab5f8be6975ea91005dd2bbf177401f8c
This commit is contained in:
Christophe Paquot
2021-06-16 09:13:58 -07:00
zatwierdzone przez Maneesh Gupta
rodzic c49f1069ab
commit 133287f31f
3 zmienionych plików z 15 dodań i 3 usunięć
+8 -1
Wyświetl plik
@@ -123,6 +123,14 @@ void HostQueue::finish() {
command->awaitCompletion();
}
command->release();
if (IS_HIP) {
ScopedLock sl(vdev()->execution());
ScopedLock l(lastCmdLock_);
if (lastEnqueueCommand_ != nullptr) {
lastEnqueueCommand_->release();
lastEnqueueCommand_ = nullptr;
}
}
ClPrint(LOG_DEBUG, LOG_CMD, "All commands finished");
}
@@ -238,7 +246,6 @@ Command* HostQueue::getLastQueuedCommand(bool retain) {
// The batch update must be lock protected to avoid a race condition
// when multiple threads submit/flush/update the batch at the same time
ScopedLock sl(vdev()->execution());
// Since the lastCmdLock_ is acquired, it is safe to read and retain the lastEnqueueCommand.
// It is guaranteed that the pointer will not change.
if (retain && lastEnqueueCommand_ != nullptr) {