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]enIoannis Assiouras authored and GitHub committed 2025-09-16 21:06:24 +01:00
1 bovenliggende ec5e9673ad
commit 605be4bebc
7 files changed
+26 -10

No files matched your search

@@ -50,6 +50,7 @@ THE SOFTWARE.
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Basic") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;
@@ -89,6 +90,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Basic") {
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Parameters") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;
@@ -124,6 +126,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Parameters") {
* - HIP_VERSION >= 5.5
*/
TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters") {
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
return;