SWDEV-505930 - Avoid static initialization of ModuleGuard (#604)

This is to prevent calling catch2 macros from outside catch2 TEST_CASE
that can lead to undefined bahavior. This change also disables
hipGetProcAddress tests that are not supported on static build.

Co-authored-by: Ioannis Assiouras <Ioannis.Assiouras@amd.com>
This commit is contained in:
systems-assistant[bot]
2025-09-16 21:06:24 +01:00
committed by GitHub
parent ec5e9673ad
commit 605be4bebc
7 changed files with 26 additions and 10 deletions
@@ -33,6 +33,11 @@ ModuleGuard ModuleGuard::LoadModule(const char* fname) {
return ModuleGuard{module};
}
ModuleGuard ModuleGuard::InitModule(const char* fname) {
HIP_CHECK(hipFree(nullptr));
return LoadModule(fname);
}
ModuleGuard ModuleGuard::LoadModuleDataFile(const char* fname) {
const auto loaded_module = LoadModuleIntoBuffer(fname);
hipModule_t module = nullptr;