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>
Este cometimento está contido em:
systems-assistant[bot]eIoannis Assiouras criou e GitHub cometeu 2025-09-16 21:06:24 +01:00
1 ascendente ec5e9673ad
cometimento 605be4bebc
7 ficheiros modificados
+26 -10

Não existem ficheiros que correspondam à sua pesquisa

@@ -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;