SWDEV-292547 - Fix for hipStreamPerThread

Change-Id: I9328c7ec92d954433f8e69732d91e65fa6fe013a
Este commit está contenido en:
Sarbojit Sarkar
2021-09-21 09:25:16 +00:00
padre 9caaa6f492
commit 9e4766d990
+4 -1
Ver fichero
@@ -292,11 +292,14 @@ public:
~stream_per_thread() {
if (m_stream != nullptr && hip::isValid(m_stream)) {
delete reinterpret_cast<hip::Stream*>(m_stream);
m_stream = nullptr;
}
}
hipStream_t& get() {
if (m_stream == nullptr) {
// There is a scenario where hipResetDevice destroys stream per thread
// hence isValid check is required to make sure only valid stream is used
if (m_stream == nullptr || !hip::isValid(m_stream)) {
ihipStreamCreate(&m_stream, hipStreamDefault, hip::Stream::Priority::Normal);
}
return m_stream;