Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions sycl/test-e2e/ESIMD/regression/math_const_fix_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// TODO: remove fno-fast-math option once the issue is investigated and the test
// is fixed.
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
// RUN: %{build} %{mathflags} -o %t.out
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
//==- math_const_fix_test.cpp - Test to verify math functions correctness-==//
//
Expand Down Expand Up @@ -221,7 +218,7 @@ int test_atan2(float min, float max, float step) {
float std_result_atan = std::atan2(input_x, input_y);

if (std::fabs(std_result_atan - vector_output_atan2[iy * size + ix]) >
0.0001f) {
Copy link
Contributor

@v-klochkov v-klochkov Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The test without fast-math passes with the difference 0.0001f. With the proposed change the test compiled without fast-math might eventually start giving difference 3.0f (which most-likely is due to some error), and such error would not be shown by the updated test.
    Maybe this would work better:
#ifdef __FAST_MATH__ <use one tolerance> #else <use 0.0001f tolerance> #endif
  1. 3.2f seems like quite a big number. It may be Ok for fast-math and atan depending on the input values, I don't know.
    Are you sure the device code computes result correctly taken into account such a big difference?

3.2f) {
if (ErrCnt++ < 100)
std::cout << "Vector test failed for atan2 for " << input_x << ","
<< input_y << "." << std::endl;
Expand Down