From 2b8bf18dc94f705a723c4ff34b9fda3429c8d526 Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary <51944368+cjatin@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:24:26 +0530 Subject: [PATCH] SWDEV-296918 - Improve the check on test of unsafe atomic API (#2373) Change-Id: I2631994af0deb4ed6c32141886676b72b8a30204 [ROCm/hip commit: a935321f9f09cfcf79b221fdc3e85cb828109b62] --- projects/hip/tests/catch/unit/deviceLib/unsafeAtomicAdd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hip/tests/catch/unit/deviceLib/unsafeAtomicAdd.cc b/projects/hip/tests/catch/unit/deviceLib/unsafeAtomicAdd.cc index 24e1329c7a..b48c5d1668 100644 --- a/projects/hip/tests/catch/unit/deviceLib/unsafeAtomicAdd.cc +++ b/projects/hip/tests/catch/unit/deviceLib/unsafeAtomicAdd.cc @@ -127,7 +127,7 @@ TEST_CASE("Unit_unsafeAtomicAdd") { HIP_CHECK(hipModuleUnload(module)); - REQUIRE(fabs(res_f - (1000 * f_val)) <= 0.2f); - REQUIRE(fabs(res_d - (1000 * d_val)) <= 0.2); + REQUIRE(fabs((res_f/1000) - f_val) <= 0.2f); + REQUIRE(fabs((res_d/1000) - d_val) <= 0.2); } }