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
committato da GitHub
parent ec5e9673ad
commit 605be4bebc
7 ha cambiato i file con 26 aggiunte e 10 eliminazioni
@@ -49,6 +49,7 @@ THE SOFTWARE.
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Positive_Basic") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;
@@ -106,6 +107,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Positive_Basic") {
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_Parameters") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;
@@ -229,6 +231,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_Parameters"
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_MultiKernelSameDevice") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;