SWDEV-420149 - Fixing unsafe atomics change for targets other than gfx90a.

Change-Id: Ifa26fd1c51505c5e86e121233c8352e3bde846ea


[ROCm/hip-tests commit: a363fa2833]
This commit is contained in:
kjayapra-amd
2023-09-06 05:14:57 -04:00
zatwierdzone przez Karthik Jayaprakash
rodzic d1028926ef
commit feaa0bbe43
6 zmienionych plików z 63 dodań i 19 usunięć
@@ -129,8 +129,13 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCnounsafeatomicflag", "",
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
nullptr, nullptr, config_d));
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
if ((gfxName == "gfx90a" || gfxName.find("gfx90a:")) == 0) {
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
} else {
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
REQUIRE(*result == INITIAL_VAL);
}
HIP_CHECK(hipHostFree(A_h));
HIP_CHECK(hipHostFree(result));
}
@@ -221,8 +226,13 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCunsafeatomicflag", "",
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
nullptr, nullptr, config_d));
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
if ((gfxName == "gfx90a" || gfxName.find("gfx90a:")) == 0) {
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
} else {
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
REQUIRE(*result == INITIAL_VAL);
}
HIP_CHECK(hipHostFree(A_h));
HIP_CHECK(hipHostFree(result));
}
@@ -309,8 +319,13 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCwithoutflag", "",
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1,
1, 0, nullptr, nullptr, config_d));
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
if ((gfxName == "gfx90a" || gfxName.find("gfx90a:")) == 0) {
REQUIRE(A_h[0] == INITIAL_VAL);
REQUIRE(*result == 0);
} else {
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
REQUIRE(*result == INITIAL_VAL);
}
HIP_CHECK(hipHostFree(A_h));
HIP_CHECK(hipHostFree(result));
}