Skip to content

Commit

Permalink
bugfix nan test for basic fpmath
Browse files Browse the repository at this point in the history
  • Loading branch information
zekai.zhou committed Feb 10, 2025
1 parent 5b35180 commit 7ec864a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test_conformance/basic/test_fpmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ int verify_fp(std::vector<T> (&input)[2], std::vector<T> &output,
auto &inB = input[1];
for (size_t i = 0; i < output.size(); i++)
{
bool nan_test = false;
bool nan_test = true;

T r = test.ref(inA[i], inB[i]);

if (std::is_same<T, cl_half>::value)
nan_test = !(isHalfNan(r) && isHalfNan(output[i]));
nan_test = (isHalfNan(r) != isHalfNan(output[i]));

if (r != output[i] && nan_test)
if (r != output[i] && !nan_test)
{
log_error("FP math test for type: %s, vec size: %zu, failed at "
"index %zu, %a '%c' %a, expected %a, get %a\n",
Expand Down

0 comments on commit 7ec864a

Please sign in to comment.