<div dir="ltr"><div><br></div><div>Signed-off-by: Sean Lynch <<a href="mailto:seanl@literati.org">seanl@literati.org</a>></div><div>---</div><div> utests/builtin_acos_asin.cpp | 12 ++++++------</div><div> utests/builtin_exp.cpp Â  Â  Â  | 12 ++++++------</div><div> utests/builtin_pow.cpp Â  Â  Â  | 12 ++++++------</div><div> utests/builtin_tgamma.cpp Â  Â | Â 4 ++--</div><div> utests/compiler_half.cpp Â  Â  | Â 4 ++--</div><div> utests/compiler_math.cpp Â  Â  | Â 8 ++++----</div><div> utests/compiler_math_2op.cpp | Â 8 ++++----</div><div> utests/compiler_math_3op.cpp | Â 8 ++++----</div><div> utests/utest_generator.py Â  Â | 20 ++++++++++----------</div><div> utests/utest_math_gen.py Â  Â  | Â 4 ++--</div><div> 10 files changed, 46 insertions(+), 46 deletions(-)</div><div><br></div><div>diff --git a/utests/builtin_acos_asin.cpp b/utests/builtin_acos_asin.cpp</div><div>index 0187226..395460b 100644</div><div>--- a/utests/builtin_acos_asin.cpp</div><div>+++ b/utests/builtin_acos_asin.cpp</div><div>@@ -59,10 +59,10 @@ static void builtin_acos_asin(void)</div><div>  Â  Â {</div><div>  Â  Â  Â index_cur = k * max_function + i;</div><div> #if udebug</div><div>- Â  Â  Â if (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])){</div><div>+ Â  Â  Â if (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])){</div><div>  Â  Â  Â  Â printf_c("%d/%d: %f -> gpu:%f Â cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);</div><div>  Â  Â  Â }</div><div>- Â  Â  Â else if (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])){</div><div>+ Â  Â  Â else if (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])){</div><div>  Â  Â  Â  Â printf_c("%d/%d: %f -> gpu:%f Â cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);</div><div>  Â  Â  Â }</div><div>  Â  Â  Â else if(fabs(gpu_data[index_cur] - cpu_data[index_cur]) > 1e-3f){</div><div>@@ -71,10 +71,10 @@ static void builtin_acos_asin(void)</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â printf("%d/%d: %f -> gpu:%f Â cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);</div><div> #else</div><div>- Â  Â  if (isinf(cpu_data[index_cur]))</div><div>- Â  Â  Â  OCL_ASSERT(isinf(gpu_data[index_cur]));</div><div>- Â  Â  else if (isnan(cpu_data[index_cur]))</div><div>- Â  Â  Â  OCL_ASSERT(isnan(gpu_data[index_cur]));</div><div>+ Â  Â  if (std::isinf(cpu_data[index_cur]))</div><div>+ Â  Â  Â  OCL_ASSERT(std::isinf(gpu_data[index_cur]));</div><div>+ Â  Â  else if (std::isnan(cpu_data[index_cur]))</div><div>+ Â  Â  Â  OCL_ASSERT(std::isnan(gpu_data[index_cur]));</div><div>  Â  Â  else</div><div>  Â  Â  {</div><div>  Â  Â  Â  OCL_ASSERT(fabs(gpu_data[index_cur] - cpu_data[index_cur]) < 1e-3f);</div><div>diff --git a/utests/builtin_exp.cpp b/utests/builtin_exp.cpp</div><div>index d5288c8..406d223 100644</div><div>--- a/utests/builtin_exp.cpp</div><div>+++ b/utests/builtin_exp.cpp</div><div>@@ -71,10 +71,10 @@ static void builtin_exp(void)</div><div>  Â  Â  Â  Â  diff/gpu_data[index_cur], 3 * FLT_ULP);</div><div> </div><div> #if udebug</div><div>- Â  Â  Â if (isinf(cpu_data[index_cur]) && isinf(gpu_data[index_cur])){</div><div>+ Â  Â  Â if (std::isinf(cpu_data[index_cur]) && std::isinf(gpu_data[index_cur])){</div><div>  Â  Â  Â  Â printf(log);</div><div>  Â  Â  Â }</div><div>- Â  Â  Â else if (isnan(cpu_data[index_cur]) && isnan(gpu_data[index_cur])){</div><div>+ Â  Â  Â else if (std::isnan(cpu_data[index_cur]) && std::isnan(gpu_data[index_cur])){</div><div>  Â  Â  Â  Â printf(log);</div><div>  Â  Â  Â }</div><div>  Â  Â  Â else if( diff / cpu_data[index_cur] < 3 * FLT_ULP \</div><div>@@ -86,10 +86,10 @@ static void builtin_exp(void)</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â printf_c(log);</div><div> #else</div><div>- Â  Â  Â if (isinf(cpu_data[index_cur]))</div><div>- Â  Â  Â  Â OCL_ASSERTM(isinf(gpu_data[index_cur]), log);</div><div>- Â  Â  Â else if (isnan(cpu_data[index_cur]))</div><div>- Â  Â  Â  Â OCL_ASSERTM(isnan(gpu_data[index_cur]), log);</div><div>+ Â  Â  Â if (std::isinf(cpu_data[index_cur]))</div><div>+ Â  Â  Â  Â OCL_ASSERTM(std::isinf(gpu_data[index_cur]), log);</div><div>+ Â  Â  Â else if (std::isnan(cpu_data[index_cur]))</div><div>+ Â  Â  Â  Â OCL_ASSERTM(std::isnan(gpu_data[index_cur]), log);</div><div>  Â  Â  Â else if ( gpu_data[index_cur] > FLT_ULP || cpu_data[index_cur] > FLT_ULP)</div><div>  Â  Â  Â  Â OCL_ASSERTM(fabs( diff / cpu_data[index_cur]) < 3 * FLT_ULP, log);</div><div>  Â  Â  Â else</div><div>diff --git a/utests/builtin_pow.cpp b/utests/builtin_pow.cpp</div><div>index f586448..21fa895 100644</div><div>--- a/utests/builtin_pow.cpp</div><div>+++ b/utests/builtin_pow.cpp</div><div>@@ -74,8 +74,8 @@ static void builtin_pow(void)</div><div>  Â  Â {</div><div>  Â  Â  Â index_cur = k * max_function + i;</div><div> #if udebug</div><div>- Â  Â  Â if ( (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])) ||</div><div>- Â  Â  Â  Â  Â  (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])) ||</div><div>+ Â  Â  Â if ( (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])) ||</div><div>+ Â  Â  Â  Â  Â  (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])) ||</div><div>  Â  Â  Â  Â  Â  (fabs(gpu_data[index_cur] - cpu_data[index_cur]) > cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR</div><div>  Â  Â  Â  Â  Â  && (denormals_supported || gpu_data[index_cur]!=0 || std::fpclassify(cpu_data[index_cur])!=FP_SUBNORMAL) ) )</div><div> </div><div>@@ -85,10 +85,10 @@ static void builtin_pow(void)</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â printf("%d/%d: x:%f, y:%f -> gpu:%f Â cpu:%f\n", k, i, input_data1[k], input_data2[k], gpu_data[index_cur], cpu_data[index_cur]);</div><div> #else</div><div>- Â  Â  if (isinf(cpu_data[index_cur]))</div><div>- Â  Â  Â  OCL_ASSERT(isinf(gpu_data[index_cur]));</div><div>- Â  Â  else if (isnan(cpu_data[index_cur]))</div><div>- Â  Â  Â  OCL_ASSERT(isnan(gpu_data[index_cur]));</div><div>+ Â  Â  if (std::isinf(cpu_data[index_cur]))</div><div>+ Â  Â  Â  OCL_ASSERT(std::isinf(gpu_data[index_cur]));</div><div>+ Â  Â  else if (std::isnan(cpu_data[index_cur]))</div><div>+ Â  Â  Â  OCL_ASSERT(std::isnan(gpu_data[index_cur]));</div><div>  Â  Â  else</div><div>  Â  Â  {</div><div>  Â  Â  Â  OCL_ASSERT((fabs(gpu_data[index_cur] - cpu_data[index_cur]) < cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR) ||</div><div>diff --git a/utests/builtin_tgamma.cpp b/utests/builtin_tgamma.cpp</div><div>index db9ab3c..204f49e 100644</div><div>--- a/utests/builtin_tgamma.cpp</div><div>+++ b/utests/builtin_tgamma.cpp</div><div>@@ -43,8 +43,8 @@ void builtin_tgamma(void)</div><div>  Â  Â  Â  Â max_ulp = fabsf(cpu - dst[i]) / cl_FLT_ULP(cpu);</div><div>  Â  Â  Â  Â max_ulp_at = src[i];</div><div>  Â  Â  Â }</div><div>- Â  Â  Â if (isinf(cpu)) {</div><div>- Â  Â  Â  Â OCL_ASSERT(isinf(dst[i]));</div><div>+ Â  Â  Â if (std::isinf(cpu)) {</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isinf(dst[i]));</div><div>  Â  Â  Â } else if (fabsf(cpu - dst[i]) >= cl_FLT_ULP(cpu) * ULPSIZE_FACTOR) {</div><div>  Â  Â  Â  Â printf("%f %f %f\n", src[i], cpu, dst[i]);</div><div>  Â  Â  Â  Â OCL_ASSERT(0);</div><div>diff --git a/utests/compiler_half.cpp b/utests/compiler_half.cpp</div><div>index d486193..194c308 100644</div><div>--- a/utests/compiler_half.cpp</div><div>+++ b/utests/compiler_half.cpp</div><div>@@ -236,7 +236,7 @@ static float half_test_src[half_n] = {</div><div>  Â  Â  Â OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || Â  Â  Â \</div><div>  Â  Â  Â  Â  Â  Â  Â  Â  (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || Â  Â  Â  Â  \</div><div>  Â  Â  Â  Â  Â  Â  Â  Â  (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \</div><div>- Â  Â  Â  Â  Â  Â  Â  Â  (isnan(f) && isnan(fdst[i]))); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  (std::isnan(f) && std::isnan(fdst[i]))); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>  Â  Â } Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>  Â  Â OCL_UNMAP_BUFFER(1); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \</div><div>  Â } Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>@@ -310,7 +310,7 @@ HALF_MATH_TEST_1ARG(ceil, ceilf);</div><div>  Â  Â OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || Â  Â  Â  Â \</div><div>  Â  Â  Â  Â  Â  Â  Â  (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || Â  Â  Â  Â  Â  \</div><div>  Â  Â  Â  Â  Â  Â  Â  (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \</div><div>- Â  Â  Â  Â  Â  Â  Â  (isnan(f) && isnan(fdst[i]))); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>+ Â  Â  Â  Â  Â  Â  Â  (std::isnan(f) && std::isnan(fdst[i]))); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>  Â  Â } Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>  Â  Â OCL_UNMAP_BUFFER(2); Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \</div><div>  Â } Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \</div><div>diff --git a/utests/compiler_math.cpp b/utests/compiler_math.cpp</div><div>index e0c4487..0c238c9 100644</div><div>--- a/utests/compiler_math.cpp</div><div>+++ b/utests/compiler_math.cpp</div><div>@@ -72,10 +72,10 @@ static void compiler_math(void)</div><div>  Â  Â for (int i = 0; i < 16; ++i) {</div><div>  Â  Â  Â const float cpu = cpu_dst[i];</div><div>  Â  Â  Â const float gpu = ((float*)buf_data[0])[i];</div><div>- Â  Â  Â if (isinf(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isinf(gpu));</div><div>- Â  Â  Â else if (isnan(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isnan(gpu));</div><div>+ Â  Â  Â if (std::isinf(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isinf(gpu));</div><div>+ Â  Â  Â else if (std::isnan(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isnan(gpu));</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);</div><div>  Â  Â }</div><div>diff --git a/utests/compiler_math_2op.cpp b/utests/compiler_math_2op.cpp</div><div>index 454967d..d771dba 100644</div><div>--- a/utests/compiler_math_2op.cpp</div><div>+++ b/utests/compiler_math_2op.cpp</div><div>@@ -65,10 +65,10 @@ static void compiler_math_2op(void)</div><div>  Â  Â for (int i = 0; i < 16; ++i) {</div><div>  Â  Â  Â const float cpu = cpu_dst[i];</div><div>  Â  Â  Â const float gpu = ((float*)buf_data[0])[i];</div><div>- Â  Â  Â if (isinf(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isinf(gpu));</div><div>- Â  Â  Â else if (isnan(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isnan(gpu));</div><div>+ Â  Â  Â if (std::isinf(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isinf(gpu));</div><div>+ Â  Â  Â else if (std::isnan(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isnan(gpu));</div><div>  Â  Â  Â else {</div><div>  Â  Â  Â  Â OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);</div><div>  Â  Â  Â }</div><div>diff --git a/utests/compiler_math_3op.cpp b/utests/compiler_math_3op.cpp</div><div>index a382b0a..f90f9d6 100644</div><div>--- a/utests/compiler_math_3op.cpp</div><div>+++ b/utests/compiler_math_3op.cpp</div><div>@@ -50,10 +50,10 @@ static void compiler_math_3op(void)</div><div>  Â  Â for (int i = 0; i < 16; ++i) {</div><div>  Â  Â  Â const float cpu = cpu_dst[i];</div><div>  Â  Â  Â const float gpu = ((float*)buf_data[0])[i];</div><div>- Â  Â  Â if (isinf(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isinf(gpu));</div><div>- Â  Â  Â else if (isnan(cpu))</div><div>- Â  Â  Â  Â OCL_ASSERT(isnan(gpu));</div><div>+ Â  Â  Â if (std::isinf(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isinf(gpu));</div><div>+ Â  Â  Â else if (std::isnan(cpu))</div><div>+ Â  Â  Â  Â OCL_ASSERT(std::isnan(gpu));</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);</div><div>  Â  Â }</div><div>diff --git a/utests/utest_generator.py b/utests/utest_generator.py</div><div>index 91cc938..2ab908e 100644</div><div>--- a/utests/utest_generator.py</div><div>+++ b/utests/utest_generator.py</div><div>@@ -112,10 +112,10 @@ def udebug(ulpSize,returnType,function):</div><div>  Â  Â ULPSIZE_FACTOR = select_ulpsize(ULPSIZE_FAST_MATH,ULPSIZE_NO_FAST_MATH);</div><div>  Â  Â bool fast_math = ULPSIZE_FACTOR == ULPSIZE_FAST_MATH;</div><div> </div><div>- Â  Â if (isinf(cpu_data[index])){</div><div>+ Â  Â if (std::isinf(cpu_data[index])){</div><div>  Â  Â  Â INFORNAN="INF";</div><div>  Â  Â }</div><div>- Â  Â else if (isnan(cpu_data[index])){</div><div>+ Â  Â else if (std::isnan(cpu_data[index])){</div><div>  Â  Â  Â INFORNAN="NAN";</div><div>  Â  Â }</div><div>  Â  Â else{</div><div>@@ -124,14 +124,14 @@ def udebug(ulpSize,returnType,function):</div><div>  Â  Â }</div><div> </div><div> #if udebug </div><div>- Â  Â if (isinf(cpu_data[index])){ </div><div>- Â  Â  Â if (isinf(gpu_data[index]))</div><div>+ Â  Â if (std::isinf(cpu_data[index])){ </div><div>+ Â  Â  Â if (std::isinf(gpu_data[index]))</div><div>  Â  Â  Â  Â printf("%s expect:%s\\n", log, INFORNAN);</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â printf_c("%s expect:%s\\n", log, INFORNAN);</div><div>  Â  Â  Â }</div><div>- Â  Â else if (isnan(cpu_data[index])){</div><div>- Â  Â  Â if (isnan(gpu_data[index]))</div><div>+ Â  Â else if (std::isnan(cpu_data[index])){</div><div>+ Â  Â  Â if (std::isnan(gpu_data[index]))</div><div>  Â  Â  Â  Â printf("%s expect:%s\\n", log, INFORNAN);</div><div>  Â  Â  Â else</div><div>  Â  Â  Â  Â printf_c("%s expect:%s\\n", log, INFORNAN);</div><div>@@ -142,13 +142,13 @@ def udebug(ulpSize,returnType,function):</div><div>  Â  Â else</div><div>  Â  Â  Â printf_c("%s expect:%s\\n", log, ULPSIZE);</div><div> #else</div><div>- Â  Â if (isinf(cpu_data[index])){</div><div>+ Â  Â if (std::isinf(cpu_data[index])){</div><div>  Â  Â  Â sprintf(log, "%s expect:%s\\n", log, INFORNAN);</div><div>- Â  Â  Â OCL_ASSERTM(isinf(gpu_data[index]) || fast_math,log);</div><div>+ Â  Â  Â OCL_ASSERTM(std::isinf(gpu_data[index]) || fast_math,log);</div><div>  Â  Â }</div><div>- Â  Â else if (isnan(cpu_data[index])){</div><div>+ Â  Â else if (std::isnan(cpu_data[index])){</div><div>  Â  Â  Â sprintf(log, "%s expect:%s\\n", log, INFORNAN);</div><div>- Â  Â  Â OCL_ASSERTM(isnan(gpu_data[index]) || fast_math,log);</div><div>+ Â  Â  Â OCL_ASSERTM(std::isnan(gpu_data[index]) || fast_math,log);</div><div>  Â  Â }</div><div>  Â  Â else{</div><div>  Â  Â  Â sprintf(log, "%s expect:%s\\n", log, ULPSIZE);</div><div>diff --git a/utests/utest_math_gen.py b/utests/utest_math_gen.py</div><div>index eca6c87..ac70979 100755</div><div>--- a/utests/utest_math_gen.py</div><div>+++ b/utests/utest_math_gen.py</div><div>@@ -490,9 +490,9 @@ static float powr(float x, float y){</div><div>  Â  Â  Â  Â return 1;</div><div>  Â  Â else if ((x == +INFINITY) && (y == 0.0f))</div><div>  Â  Â  Â  Â return NAN;</div><div>- Â  Â else if (isnan(x) || (x < 0))</div><div>+ Â  Â else if (std::isnan(x) || (x < 0))</div><div>  Â  Â  Â  Â return NAN;</div><div>- Â  Â else if ((x >= Â 0) && (isnan(y)))</div><div>+ Â  Â else if ((x >= Â 0) && (std::isnan(y)))</div><div>  Â  Â  Â  Â return NAN;</div><div>  Â  Â else</div><div>  Â  Â  Â  Â return powf(x,y);</div><div>-- </div><div>2.7.4</div><div><br></div></div>