SWDEV-298331 - Fix FreeLibrary throw exception issue on Windows

release HIP resource at DLL_PROCESS_DETACH point

Change-Id: Icfaf93d7d1be422b55dc0b17d1ba506abcd8d80b


[ROCm/clr commit: 9e31739919]
이 커밋은 다음에 포함됨:
haoyuan2 작성하고 Hao Yuan가 2022-02-25 18:12:00 -05:00를 커밋함
1 부모 f169ab9c07
커밋 6217103b57
1 파일이 변경됨
+11 -1
+11 -1
파일 보기
@@ -1,4 +1,4 @@
/* Copyright (c) 2018 - 2021 Advanced Micro Devices, Inc.
/* Copyright (c) 2018 - 2022 Advanced Micro Devices, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -37,6 +37,16 @@ amd::HostQueue* Device::NullStream(bool skip_alloc) {
}
namespace amd {
void shutDown() {
for (auto deviceHandle : g_devices) {
delete deviceHandle;
}
}
} // namespace amd
hipError_t ihipDeviceGet(hipDevice_t* device, int deviceId) {
if (deviceId < 0 || static_cast<size_t>(deviceId) >= g_devices.size() || device == nullptr) {
return hipErrorInvalidDevice;