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:
@@ -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 {
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele