SWDEV-292547 - Fix for hipStreamPerThread
Change-Id: I9328c7ec92d954433f8e69732d91e65fa6fe013a
[ROCm/clr commit: 9e4766d990]
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user