SWDEV-518831 - fix streams' sync issue in mthreads (#123)

* SWDEV-518831 - fix streams' sync issue in mthreads

1. Fix sync issue of null stream and non-null streams in
multithreads.
2. Remove assert(GetSubmissionBatch() == nullptr) as it
is invalid in multithreads.
3. Update getActiveQueues() to deal with the state of 
being terminated.
Tento commit je obsažen v:
Sang, Tao
2025-04-23 15:08:07 -04:00
odevzdal GitHub
rodič 78f92901d8
revize 27aad09bd4
4 změnil soubory, kde provedl 18 přidání a 4 odebrání
+15
Zobrazit soubor
@@ -1107,6 +1107,21 @@ void Device::IpcDetach(void* dev_ptr) const {
}
}
std::vector<amd::CommandQueue*> Device::getActiveQueues() {
amd::ScopedLock lock(activeQueuesLock_);
for (auto it = activeQueues.begin(); it != activeQueues.end();) {
if ((*it)->referenceCount() == 0) {
// It is being terminated in HostQueue::terminate().
// We should not wait for commands in a queue being terminated.
it = activeQueues.erase(it);
} else {
// In case the queue will be destroyed in Stream::Destroy().
(*it)->retain();
++it;
}
}
return std::vector<amd::CommandQueue*>(activeQueues.begin(), activeQueues.end());
}
} // namespace amd
namespace amd::device {