diff --git a/sycl/test-e2e/ESIMD/Stencil.cpp b/sycl/test-e2e/ESIMD/Stencil.cpp index 7bc07960e103d..9486eaba555c6 100644 --- a/sycl/test-e2e/ESIMD/Stencil.cpp +++ b/sycl/test-e2e/ESIMD/Stencil.cpp @@ -58,7 +58,7 @@ bool CheckResults(float *out, float *in, unsigned n) { in[(i + 5) * n + (j + 0)] * 0.02f; // check result - if (abs(res - out[i * n + j]) >= 0.0015f) { + if (std::abs(res - out[i * n + j]) >= 0.0015f) { std::cout << "out[" << i << "][" << j << "] = " << out[i * n + j] << " expect result " << res << std::endl; return false; diff --git a/sycl/test-e2e/ESIMD/api/bin_and_cmp_ops_heavy.cpp b/sycl/test-e2e/ESIMD/api/bin_and_cmp_ops_heavy.cpp index 012a2f20cbe94..66b434d9f9cef 100644 --- a/sycl/test-e2e/ESIMD/api/bin_and_cmp_ops_heavy.cpp +++ b/sycl/test-e2e/ESIMD/api/bin_and_cmp_ops_heavy.cpp @@ -212,7 +212,7 @@ template struct verify_n { using Tint = esimd_test::int_type_t; Tint res_bits = *(Tint *)&res; Tint gold_bits = *(Tint *)&gold; - return (abs(gold_bits - res_bits) > n) ? false : true; + return (std::abs(gold_bits - res_bits) > n) ? false : true; } }; diff --git a/sycl/test-e2e/ESIMD/api/unary_ops_heavy.cpp b/sycl/test-e2e/ESIMD/api/unary_ops_heavy.cpp index 50778fef19ff8..f360630478e8e 100644 --- a/sycl/test-e2e/ESIMD/api/unary_ops_heavy.cpp +++ b/sycl/test-e2e/ESIMD/api/unary_ops_heavy.cpp @@ -125,7 +125,7 @@ bool test(Ops ops, queue &q) { ? 1 : 0; - if ((Gold != Res) && (abs(ResBits - GoldBits) > delta)) { + if ((Gold != Res) && (std::abs(ResBits - GoldBits) > delta)) { if (++err_cnt < 10) { std::cout << " failed at index " << (res_off + j) << ", op " << esimd_test::Op2Str(op) << ": " << cast(Res) diff --git a/sycl/test-e2e/ESIMD/esimd_test_utils.hpp b/sycl/test-e2e/ESIMD/esimd_test_utils.hpp index 422b09b62d9da..0de584191bd41 100644 --- a/sycl/test-e2e/ESIMD/esimd_test_utils.hpp +++ b/sycl/test-e2e/ESIMD/esimd_test_utils.hpp @@ -149,7 +149,7 @@ bool cmp_binary_files(const char *testOutFile, const char *referenceFile, double maxRelativeDiff = 0; bool status = true; for (size_t i = 0; i < size; i++) { - const auto diff = abs(testVec[i] - referenceVec[i]); + const auto diff = std::abs(testVec[i] - referenceVec[i]); if (diff > tolerance) { if (!mismatchRateTolerance || (totalMismatches < mismatchReportLimit)) { diff --git a/sycl/test-e2e/ESIMD/ext_math.cpp b/sycl/test-e2e/ESIMD/ext_math.cpp index 215868a367233..47a9e7b251532 100644 --- a/sycl/test-e2e/ESIMD/ext_math.cpp +++ b/sycl/test-e2e/ESIMD/ext_math.cpp @@ -377,7 +377,7 @@ bool test(queue &Q, const std::string &Name, } bool BothFinite = std::isfinite(Test) && std::isfinite(Gold); - if (BothFinite && abs(Test - Gold) > delta) { + if (BothFinite && std::abs(Test - Gold) > delta) { if (++ErrCnt < 10) { std::cout << " failed at index " << I << ", " << Test << " != " << Gold << " (gold)\n"; diff --git a/sycl/test-e2e/ESIMD/kmeans/kmeans.cpp b/sycl/test-e2e/ESIMD/kmeans/kmeans.cpp index 180f2db54a214..50328431ea0c0 100644 --- a/sycl/test-e2e/ESIMD/kmeans/kmeans.cpp +++ b/sycl/test-e2e/ESIMD/kmeans/kmeans.cpp @@ -80,8 +80,9 @@ bool verify_result(Centroid4 *centroids4, // gpu centroids result float errY = std::fabs(centroids4[j].y[k] - centroids[i].y) / max(std::fabs(centroids4[j].y[k]), std::fabs(centroids[i].y)); float errSize = - abs(centroids4[j].num_points[k] - centroids[i].num_points) / - max(abs(centroids4[j].num_points[k]), abs(centroids[i].num_points)); + std::abs(centroids4[j].num_points[k] - centroids[i].num_points) / + max(std::abs(centroids4[j].num_points[k]), + std::abs(centroids[i].num_points)); // std::cout << i << ": Wanted (" << centroids[i].x << ", " << // centroids[i].y // << ", " << centroids[i].num_points << ")" << std::endl; diff --git a/sycl/test-e2e/ESIMD/linear/bitmap_helpers.h b/sycl/test-e2e/ESIMD/linear/bitmap_helpers.h index e6c8863bd4c82..466ecf79f0882 100644 --- a/sycl/test-e2e/ESIMD/linear/bitmap_helpers.h +++ b/sycl/test-e2e/ESIMD/linear/bitmap_helpers.h @@ -255,8 +255,8 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) { return false; } - width = abs(*(short *)&header_out[18]); - height = abs(*(short *)&header_out[22]); + width = std::abs(*(short *)&header_out[18]); + height = std::abs(*(short *)&header_out[22]); img_out = (unsigned char *)std::malloc(width * height * 3); img_gold = (unsigned char *)std::malloc(width * height * 3); @@ -276,7 +276,7 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) { fclose(f_gold); for (i = 0; i < width * height * 3; i++) { - if (abs(img_out[i] - img_gold[i]) > tolerance) { + if (std::abs(img_out[i] - img_gold[i]) > tolerance) { return false; } } diff --git a/sycl/test-e2e/ESIMD/stencil2.cpp b/sycl/test-e2e/ESIMD/stencil2.cpp index 0589b446b1911..c7969ce2c1398 100644 --- a/sycl/test-e2e/ESIMD/stencil2.cpp +++ b/sycl/test-e2e/ESIMD/stencil2.cpp @@ -59,7 +59,7 @@ bool CheckResults(float *out, float *in, unsigned n) { in[(i + 5) * n + (j + 0)] * 0.02f; // check result - if (abs(res - out[i * n + j]) >= 0.0015f) { + if (std::abs(res - out[i * n + j]) >= 0.0015f) { std::cout << "out[" << i << "][" << j << "] = " << out[i * n + j] << " expect result " << res << std::endl; return false; diff --git a/sycl/test-e2e/ESIMD/vadd_half.cpp b/sycl/test-e2e/ESIMD/vadd_half.cpp index 23a0e1944c6ba..dde3e845e5cbf 100644 --- a/sycl/test-e2e/ESIMD/vadd_half.cpp +++ b/sycl/test-e2e/ESIMD/vadd_half.cpp @@ -98,7 +98,7 @@ int main(int argc, char **argv) { Tint ResBits = *(Tint *)&Res; Tint GoldBits = *(Tint *)&Gold; - if (abs(ResBits - GoldBits) > 1) { + if (std::abs(ResBits - GoldBits) > 1) { if (++err_cnt < 100) { std::cout << "failed at index " << i << ": " << cast(Res) << "(0x" << std::hex << ResBits << ")" diff --git a/sycl/test-e2e/GroupAlgorithm/SYCL2020/reduce_over_group_size.cpp b/sycl/test-e2e/GroupAlgorithm/SYCL2020/reduce_over_group_size.cpp index 40e2b4fa04794..47dca77127e27 100644 --- a/sycl/test-e2e/GroupAlgorithm/SYCL2020/reduce_over_group_size.cpp +++ b/sycl/test-e2e/GroupAlgorithm/SYCL2020/reduce_over_group_size.cpp @@ -91,7 +91,7 @@ int main() { } for (int j = 0; j < NV; j++) { auto d = s[j] - r[k * NV + j]; - if (abs(d) > 1e-10) { + if (std::abs(d) > 1e-10) { printf("partial fail "); printf("%i\t%i\t%g\t%g\n", k, j, s[j], r[k * NV + j]); fails++;