Skip to content

Commit 57cf62c

Browse files
author
Jakub Chlanda
authored
[SYCL] Disable fast math in math_ops and marray_common tests (#15223)
We've seen those tests failing when release testing. It boils down to the fact that `icpx` will by default (with no user input) enable fast math mode. * `marray_common.cpp` - uses golden values alongside allowed delta, however in fast math mode the calculation error is greater than the delta * `math_ops.cpp` - uses `isnan`, which compilers are not obliged to honour in fast math mode. If nothing else, those tests are a perfect example of how forcing fast math mode on can cause non-obvious errors in, otherwise sound, user code when floating point types are being used.
1 parent 14732fc commit 57cf62c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/test-e2e/Basic/built-ins/marray_common.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %{build} -o %t.out
1+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
2+
3+
// RUN: %{build} %{mathflags} -o %t.out
24
// RUN: %{run} %t.out
35
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t_preview.out %}
46
// RUN: %if preview-breaking-changes-supported %{ %{run} %t_preview.out%}

sycl/test-e2e/syclcompat/math/math_ops.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* tests for non-vectorized math helper functions
2121
**************************************************************************/
2222

23-
// RUN: %{build} -o %t.out
23+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
24+
25+
// RUN: %{build} %{mathflags} -o %t.out
2426
// RUN: %{run} %t.out
2527

2628
#include <syclcompat/dims.hpp>

0 commit comments

Comments
 (0)