SWDEV-505503 - Use internal device synchronize function in __hipUnregisterFatBinary

This is to avoid calling the HIP_INIT macro during the shutdown process.

Change-Id: I2e65f6e10491918a17445ee1e8ddd08286070358
Цей коміт міститься в:
Ioannis Assiouras
2024-12-23 11:47:23 +00:00
джерело 9d8d35ae40
коміт 5e3a29078d
+7 -3
Переглянути файл
@@ -185,10 +185,14 @@ void __hipRegisterTexture(
}
void __hipUnregisterFatBinary(hip::FatBinaryInfo** modules) {
// By calling hipDeviceSynchronize ensure that all HSA signal handlers
// complete before removeFatBinary
static std::once_flag unregister_device_sync;
std::call_once(unregister_device_sync, hipDeviceSynchronize);
std::call_once(unregister_device_sync, [](){
for (auto& hipDevice : g_devices) {
// By synchronizing devices ensure that all HSA signal handlers
// complete before removeFatBinary
hipDevice->SyncAllStreams(true);
}
});
hipError_t err = PlatformState::instance().removeFatBinary(modules);
guarantee((err == hipSuccess), "Cannot Unregister Fat Binary, error:%d", err);
}