SWDEV-462192 SWDEV-459056 Check if m_streams is empty
1) Since g_devices is not initialized when stream_per_thread constructor is called on windows, m_streams is empty when hipDeviceReset is called. 2) clear_spt tries to access empty vector causing segfaults in hipDeviceReset call. 3) on linux ROCCLR_INIT_PRIORITY makes sure that g_devices is initialized first before tls constructor creates stream_per_thread object. Change-Id: Ib2ba643d1278d820287ea3b242ed0878d7529165
Этот коммит содержится в:
коммит произвёл
Rahul Manocha
родитель
a02888af58
Коммит
450eca293b
@@ -237,7 +237,9 @@ hipStream_t stream_per_thread::get() {
|
||||
}
|
||||
|
||||
void stream_per_thread::clear_spt() {
|
||||
m_streams[getCurrentDevice()->deviceId()] = nullptr;
|
||||
if (!m_streams.empty()) {
|
||||
m_streams[getCurrentDevice()->deviceId()] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user