From 338a720b0ae375507025785b5f3ba40e66663f06 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Wed, 28 Aug 2024 15:05:00 -0700 Subject: [PATCH] [SYCL][E2E] Add non-zero "delta" for `degrees`/`radians` tests We've observed some failures due to produced results being not exact 180/`M_PI`, e.g. due to the use of FMA instructions. `half` versions of the test cases already used a delta to perform comparison, use the same for `float`/`double`. --- sycl/test-e2e/Basic/built-ins/marray_common.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/marray_common.cpp b/sycl/test-e2e/Basic/built-ins/marray_common.cpp index c1fbfe6644f75..dca9b288014ba 100644 --- a/sycl/test-e2e/Basic/built-ins/marray_common.cpp +++ b/sycl/test-e2e/Basic/built-ins/marray_common.cpp @@ -37,8 +37,8 @@ int main() { test(F(clamp), marray{1.0f, 2.0f}, ma1, 1.0f, 3.0f); test(has_fp64, F(clamp), marray{1.0, 2.0}, ma4, 1.0, 3.0); // degrees - test(F(degrees), marray{180, 180, 180}, ma5); - test(has_fp64, F(degrees), marray{180, 180, 180}, ma6); + test(0.2, F(degrees), marray{180, 180, 180}, ma5); + test(has_fp64, 0.2, F(degrees), marray{180, 180, 180}, ma6); test(has_fp16, 0.2, F(degrees), marray{180, 180, 180}, ma7); // max test(F(max), marray{3.0f, 2.0f}, ma1, ma3); @@ -53,8 +53,8 @@ int main() { test(F(mix), marray{1.4f, 2.0f}, ma1, ma3, 0.2f); test(has_fp64, F(mix), marray{3.0, 5.0}, ma4, ma9, 0.5); // radians - test(F(radians), marray{M_PI, M_PI, M_PI}, ma10); - test(has_fp64, F(radians), marray{M_PI, M_PI, M_PI}, ma11); + test(0.002, F(radians), marray{M_PI, M_PI, M_PI}, ma10); + test(has_fp64, 0.002, F(radians), marray{M_PI, M_PI, M_PI}, ma11); test(has_fp16, 0.002, F(radians), marray{M_PI, M_PI, M_PI}, ma12); // step test(F(step), marray{1.0f, 1.0f}, ma1, ma3);