Skip to content

Commit

Permalink
fixed clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Jan 10, 2025
1 parent e949d79 commit 1092b95
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test_conformance/math_brute_force/binary_operator_float.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
cl_float *s2 = 0;
RoundingMode oldRoundMode;

bool reciprocal=strcmp(name, "reciprocal") == 0;
const float reciprocalArrayX [] = { 1.f };
const float * specialValuesX = reciprocal ? reciprocalArrayX : specialValues;
bool reciprocal = strcmp(name, "reciprocal") == 0;
const float reciprocalArrayX[] = { 1.f };
const float *specialValuesX = reciprocal ? reciprocalArrayX : specialValues;
size_t specialValuesCountX = reciprocal ? 1 : specialValuesCount;

if (relaxedMode)
Expand Down Expand Up @@ -278,8 +278,7 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
{
cl_uint p2j = p2[idx] & 0x7fffffff;
// Replace values outside [2^-126, 2^126] with QNaN
if (p2j < 0x00807d99 || p2j > 0x7e800000)
p2[idx] = 0x7fc00000;
if (p2j < 0x00807d99 || p2j > 0x7e800000) p2[idx] = 0x7fc00000;
}
}
}
Expand All @@ -302,8 +301,7 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
{
cl_uint p2j = p2[idx] & 0x7fffffff;
// Replace values outside [2^-126, 2^126] with QNaN
if (p2j < 0x00807d99 || p2j > 0x7e800000)
p2[idx] = 0x7fc00000;
if (p2j < 0x00807d99 || p2j > 0x7e800000) p2[idx] = 0x7fc00000;
}
}

Expand Down Expand Up @@ -480,7 +478,8 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
if (t[j] != q[j])
{
float test = ((float *)q)[j];
double correct = reciprocal ? func.f_f(s2[j]) : func.f_ff(s[j], s2[j]);
double correct =
reciprocal ? func.f_f(s2[j]) : func.f_ff(s[j], s2[j]);

// Per section 10 paragraph 6, accept any result if an input or
// output is a infinity or NaN or overflow
Expand Down Expand Up @@ -623,8 +622,10 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)

if (!gInfNanSupport) feclearexcept(FE_OVERFLOW);

correct2 = reciprocal ? func.f_f( 0.0) : func.f_ff(s[j], 0.0);
correct3 = reciprocal ? func.f_f(-0.0) : func.f_ff(s[j], -0.0);
correct2 =
reciprocal ? func.f_f(0.0) : func.f_ff(s[j], 0.0);
correct3 =
reciprocal ? func.f_f(-0.0) : func.f_ff(s[j], -0.0);

// Per section 10 paragraph 6, accept any result if an
// input or output is a infinity or NaN or overflow
Expand Down

0 comments on commit 1092b95

Please sign in to comment.