mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Conversion to testHarness - math_brute_force
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
committed by
Kévin Petit
parent
aadfe3c5a7
commit
084828bbd8
@@ -26,6 +26,7 @@ set(${MODULE_NAME}_SOURCES
|
||||
../../test_common/harness/parseParameters.cpp
|
||||
../../test_common/harness/kernelHelpers.c
|
||||
../../test_common/harness/errorHelpers.c
|
||||
../../test_common/harness/testHarness.c
|
||||
)
|
||||
|
||||
|
||||
@@ -49,27 +50,7 @@ set_source_files_properties(
|
||||
endif(NOT ANDROID)
|
||||
|
||||
set_source_files_properties(
|
||||
FunctionList.c
|
||||
Sleep.c
|
||||
binary.c
|
||||
binaryOperator.c
|
||||
Utility.c
|
||||
binary_i.c
|
||||
binary_two_results_i.c
|
||||
i_unary.c
|
||||
macro_binary.c
|
||||
macro_unary.c
|
||||
mad.c
|
||||
main.c
|
||||
reference_math.c
|
||||
ternary.c
|
||||
unary.c
|
||||
unary_two_results.c
|
||||
unary_two_results_i.c unary_u.c
|
||||
../../test_common/harness/rounding_mode.c
|
||||
../../test_common/harness/ThreadPool.c
|
||||
../../test_common/harness/msvc9.c
|
||||
../../test_common/harness/parseParameters.cpp
|
||||
${MODULE_NAME}_SOURCES
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
|
||||
if (NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID)
|
||||
|
||||
@@ -85,7 +85,7 @@ typedef struct Func
|
||||
float relaxed_error;
|
||||
int ftz;
|
||||
int relaxed;
|
||||
const ::vtbl *vtbl;
|
||||
const vtbl *vtbl_ptr;
|
||||
}Func;
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include "../../test_common/harness/rounding_mode.h"
|
||||
#include "../../test_common/harness/fpcontrol.h"
|
||||
|
||||
#if defined( _WIN32) && defined (_MSC_VER)
|
||||
#include "../../test_common/harness/testHarness.h"
|
||||
#endif
|
||||
|
||||
#include "../../test_common/harness/ThreadPool.h"
|
||||
#define BUFFER_SIZE (1024*1024*2)
|
||||
|
||||
@@ -112,7 +108,7 @@ extern "C" {
|
||||
float Abs_Error( float test, double reference );
|
||||
float Ulp_Error( float test, double reference );
|
||||
//float Ulp_Error_Half( float test, double reference );
|
||||
float Ulp_Error_Double( double test, long double reference );
|
||||
float Bruteforce_Ulp_Error_Double( double test, long double reference );
|
||||
#ifdef __cplusplus
|
||||
} //extern "C"
|
||||
#endif
|
||||
|
||||
@@ -1380,7 +1380,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
cl_double test = ((cl_double*) q)[j];
|
||||
long double correct = func.f_ff( s[j], s2[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= ulps);
|
||||
|
||||
if( fail && ftz )
|
||||
@@ -1420,8 +1420,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_ff( 0.0, s2[j] );
|
||||
long double correct3 = func.f_ff( -0.0, s2[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -1443,10 +1443,10 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
correct3 = func.f_ff( -0.0, 0.0 );
|
||||
long double correct4 = func.f_ff( 0.0, -0.0 );
|
||||
long double correct5 = func.f_ff( -0.0, -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)) &&
|
||||
(!(fabsf(err4) <= ulps)) && (!(fabsf(err5) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -1472,8 +1472,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_ff( s[j], 0.0 );
|
||||
long double correct3 = func.f_ff( s[j], -0.0 );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
@@ -1324,7 +1324,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
cl_double test = ((cl_double*) q)[j];
|
||||
long double correct = func.f_ff( s[j], s2[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= ulps);
|
||||
|
||||
if( fail && ftz )
|
||||
@@ -1343,8 +1343,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_ff( 0.0, s2[j] );
|
||||
long double correct3 = func.f_ff( -0.0, s2[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -1366,10 +1366,10 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
correct3 = func.f_ff( -0.0, 0.0 );
|
||||
long double correct4 = func.f_ff( 0.0, -0.0 );
|
||||
long double correct5 = func.f_ff( -0.0, -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)) &&
|
||||
(!(fabsf(err4) <= ulps)) && (!(fabsf(err5) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -1395,8 +1395,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_ff( s[j], 0.0 );
|
||||
long double correct3 = func.f_ff( s[j], -0.0 );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
@@ -1149,7 +1149,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
cl_double test = ((cl_double*) q)[j];
|
||||
long double correct = func.f_fi( s[j], s2[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= ulps);
|
||||
|
||||
if( fail && ftz )
|
||||
@@ -1167,8 +1167,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_fi( 0.0, s2[j] );
|
||||
long double correct3 = func.f_fi( -0.0, s2[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
@@ -871,7 +871,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d)
|
||||
double test = ((double*) q)[j];
|
||||
int correct2 = INT_MIN;
|
||||
long double correct = f->dfunc.f_ffpI( s[j], s2[j], &correct2 );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int64_t iErr;
|
||||
|
||||
// in case of remquo, we only care about the sign and last seven bits of
|
||||
@@ -907,8 +907,8 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d)
|
||||
int correct3i, correct4i;
|
||||
long double correct3 = f->dfunc.f_ffpI( 0.0, s2[j], &correct3i );
|
||||
long double correct4 = f->dfunc.f_ffpI( -0.0, s2[j], &correct4i );
|
||||
float err2 = Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Ulp_Error_Double( test, correct4 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
int64_t iErr3 = (long long) q2[j] - (long long) correct3i;
|
||||
int64_t iErr4 = (long long) q2[j] - (long long) correct4i;
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps && iErr3 == 0)) && (!(fabsf(err3) <= f->double_ulps && iErr4 == 0)));
|
||||
@@ -937,10 +937,10 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d)
|
||||
correct4 = f->dfunc.f_ffpI( -0.0, 0.0, &correct4i );
|
||||
long double correct7 = f->dfunc.f_ffpI( 0.0, -0.0, &correct7i );
|
||||
long double correct8 = f->dfunc.f_ffpI( -0.0, -0.0, &correct8i );
|
||||
err2 = Ulp_Error_Double( test, correct3 );
|
||||
err3 = Ulp_Error_Double( test, correct4 );
|
||||
float err4 = Ulp_Error_Double( test, correct7 );
|
||||
float err5 = Ulp_Error_Double( test, correct8 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct7 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct8 );
|
||||
iErr3 = (long long) q2[j] - (long long) correct3i;
|
||||
iErr4 = (long long) q2[j] - (long long) correct4i;
|
||||
int64_t iErr7 = (long long) q2[j] - (long long) correct7i;
|
||||
@@ -979,8 +979,8 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d)
|
||||
int correct3i, correct4i;
|
||||
long double correct3 = f->dfunc.f_ffpI( s[j], 0.0, &correct3i );
|
||||
long double correct4 = f->dfunc.f_ffpI( s[j], -0.0, &correct4i );
|
||||
float err2 = Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Ulp_Error_Double( test, correct4 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
int64_t iErr3 = (long long) q2[j] - (long long) correct3i;
|
||||
int64_t iErr4 = (long long) q2[j] - (long long) correct4i;
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps && iErr3 == 0)) && (!(fabsf(err3) <= f->double_ulps && iErr4 == 0)));
|
||||
|
||||
@@ -785,7 +785,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
{
|
||||
double test = ((double*) q)[j];
|
||||
long double correct = f->dfunc.f_fff( s[j], s2[j], s3[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= f->double_ulps);
|
||||
|
||||
if( fail && ftz )
|
||||
@@ -803,8 +803,8 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
{ // look at me,
|
||||
long double correct2 = f->dfunc.f_fff( 0.0, s2[j], s3[j] );
|
||||
long double correct3 = f->dfunc.f_fff( -0.0, s2[j], s3[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -826,10 +826,10 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( -0.0, 0.0, s3[j] );
|
||||
long double correct4 = f->dfunc.f_fff( 0.0, -0.0, s3[j] );
|
||||
long double correct5 = f->dfunc.f_fff( -0.0, -0.0, s3[j] );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -860,14 +860,14 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
long double correct7 = f->dfunc.f_fff( -0.0, 0.0, -0.0f );
|
||||
long double correct8 = f->dfunc.f_fff( 0.0, -0.0, -0.0f );
|
||||
long double correct9 = f->dfunc.f_fff( -0.0, -0.0, -0.0f );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
err4 = Ulp_Error_Double( test, correct4 );
|
||||
err5 = Ulp_Error_Double( test, correct5 );
|
||||
float err6 = Ulp_Error_Double( test, correct6 );
|
||||
float err7 = Ulp_Error_Double( test, correct7 );
|
||||
float err8 = Ulp_Error_Double( test, correct8 );
|
||||
float err9 = Ulp_Error_Double( test, correct9 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
float err6 = Bruteforce_Ulp_Error_Double( test, correct6 );
|
||||
float err7 = Bruteforce_Ulp_Error_Double( test, correct7 );
|
||||
float err8 = Bruteforce_Ulp_Error_Double( test, correct8 );
|
||||
float err9 = Bruteforce_Ulp_Error_Double( test, correct9 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)) &&
|
||||
(!(fabsf(err5) <= f->double_ulps)) && (!(fabsf(err6) <= f->double_ulps)) &&
|
||||
@@ -907,10 +907,10 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( -0.0, s2[j], 0.0 );
|
||||
long double correct4 = f->dfunc.f_fff( 0.0, s2[j], -0.0 );
|
||||
long double correct5 = f->dfunc.f_fff( -0.0, s2[j], -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -936,8 +936,8 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
{
|
||||
long double correct2 = f->dfunc.f_fff( s[j], 0.0, s3[j] );
|
||||
long double correct3 = f->dfunc.f_fff( s[j], -0.0, s3[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -959,10 +959,10 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( s[j], -0.0, 0.0 );
|
||||
long double correct4 = f->dfunc.f_fff( s[j], 0.0, -0.0 );
|
||||
long double correct5 = f->dfunc.f_fff( s[j], -0.0, -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -988,8 +988,8 @@ int TestFunc_mad_Double(const Func *f, MTdata d)
|
||||
{
|
||||
long double correct2 = f->dfunc.f_fff( s[j], s2[j], 0.0 );
|
||||
long double correct3 = f->dfunc.f_fff( s[j], s2[j], -0.0 );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1010,7 +1010,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
{
|
||||
double test = ((double*) q)[j];
|
||||
long double correct = f->dfunc.f_fff( s[j], s2[j], s3[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= f->double_ulps);
|
||||
|
||||
if( fail && ftz )
|
||||
@@ -1028,8 +1028,8 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
{ // look at me,
|
||||
long double correct2 = f->dfunc.f_fff( 0.0, s2[j], s3[j] );
|
||||
long double correct3 = f->dfunc.f_fff( -0.0, s2[j], s3[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -1051,10 +1051,10 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( -0.0, 0.0, s3[j] );
|
||||
long double correct4 = f->dfunc.f_fff( 0.0, -0.0, s3[j] );
|
||||
long double correct5 = f->dfunc.f_fff( -0.0, -0.0, s3[j] );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -1085,14 +1085,14 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
long double correct7 = f->dfunc.f_fff( -0.0, 0.0, -0.0f );
|
||||
long double correct8 = f->dfunc.f_fff( 0.0, -0.0, -0.0f );
|
||||
long double correct9 = f->dfunc.f_fff( -0.0, -0.0, -0.0f );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
err4 = Ulp_Error_Double( test, correct4 );
|
||||
err5 = Ulp_Error_Double( test, correct5 );
|
||||
float err6 = Ulp_Error_Double( test, correct6 );
|
||||
float err7 = Ulp_Error_Double( test, correct7 );
|
||||
float err8 = Ulp_Error_Double( test, correct8 );
|
||||
float err9 = Ulp_Error_Double( test, correct9 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
float err6 = Bruteforce_Ulp_Error_Double( test, correct6 );
|
||||
float err7 = Bruteforce_Ulp_Error_Double( test, correct7 );
|
||||
float err8 = Bruteforce_Ulp_Error_Double( test, correct8 );
|
||||
float err9 = Bruteforce_Ulp_Error_Double( test, correct9 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)) &&
|
||||
(!(fabsf(err5) <= f->double_ulps)) && (!(fabsf(err6) <= f->double_ulps)) &&
|
||||
@@ -1132,10 +1132,10 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( -0.0, s2[j], 0.0 );
|
||||
long double correct4 = f->dfunc.f_fff( 0.0, s2[j], -0.0 );
|
||||
long double correct5 = f->dfunc.f_fff( -0.0, s2[j], -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -1161,8 +1161,8 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
{
|
||||
long double correct2 = f->dfunc.f_fff( s[j], 0.0, s3[j] );
|
||||
long double correct3 = f->dfunc.f_fff( s[j], -0.0, s3[j] );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
@@ -1184,10 +1184,10 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
correct3 = f->dfunc.f_fff( s[j], -0.0, 0.0 );
|
||||
long double correct4 = f->dfunc.f_fff( s[j], 0.0, -0.0 );
|
||||
long double correct5 = f->dfunc.f_fff( s[j], -0.0, -0.0 );
|
||||
err2 = Ulp_Error_Double( test, correct2 );
|
||||
err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Ulp_Error_Double( test, correct5 );
|
||||
err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err4 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
float err5 = Bruteforce_Ulp_Error_Double( test, correct5 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)) &&
|
||||
(!(fabsf(err4) <= f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
@@ -1213,8 +1213,8 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d)
|
||||
{
|
||||
long double correct2 = f->dfunc.f_fff( s[j], s2[j], 0.0 );
|
||||
long double correct3 = f->dfunc.f_fff( s[j], s2[j], -0.0 );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <= f->double_ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
@@ -903,7 +903,7 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
cl_double test = ((cl_double*) q)[j];
|
||||
long double correct = func.f_f( s[j] );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
int fail = ! (fabsf(err) <= ulps);
|
||||
|
||||
if( fail )
|
||||
@@ -923,8 +923,8 @@ static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data )
|
||||
{
|
||||
long double correct2 = func.f_f( 0.0L );
|
||||
long double correct3 = func.f_f( -0.0L );
|
||||
float err2 = Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Ulp_Error_Double( test, correct3 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
fail = fail && ((!(fabsf(err2) <= ulps)) && (!(fabsf(err3) <= ulps)));
|
||||
if( fabsf( err2 ) < fabsf(err ) )
|
||||
err = err2;
|
||||
|
||||
@@ -800,8 +800,8 @@ int TestFunc_Double2_Double(const Func *f, MTdata d)
|
||||
double test2 = ((double*) q2)[j];
|
||||
long double correct2;
|
||||
long double correct = f->dfunc.f_fpf( s[j], &correct2 );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err2 = Ulp_Error_Double( test2, correct2 );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test2, correct2 );
|
||||
int fail = ! (fabsf(err) <= f->double_ulps && fabsf(err2) <= f->double_ulps);
|
||||
if( ftz )
|
||||
{
|
||||
@@ -837,10 +837,10 @@ int TestFunc_Double2_Double(const Func *f, MTdata d)
|
||||
long double correct2p, correct2n;
|
||||
long double correctp = f->dfunc.f_fpf( 0.0, &correct2p );
|
||||
long double correctn = f->dfunc.f_fpf( -0.0, &correct2n );
|
||||
float errp = Ulp_Error_Double( test, correctp );
|
||||
float err2p = Ulp_Error_Double( test, correct2p );
|
||||
float errn = Ulp_Error_Double( test, correctn );
|
||||
float err2n = Ulp_Error_Double( test, correct2n );
|
||||
float errp = Bruteforce_Ulp_Error_Double( test, correctp );
|
||||
float err2p = Bruteforce_Ulp_Error_Double( test, correct2p );
|
||||
float errn = Bruteforce_Ulp_Error_Double( test, correctn );
|
||||
float err2n = Bruteforce_Ulp_Error_Double( test, correct2n );
|
||||
fail = fail && ((!(fabsf(errp) <= f->double_ulps)) && (!(fabsf(err2p) <= f->double_ulps)) &&
|
||||
((!(fabsf(errn) <= f->double_ulps)) && (!(fabsf(err2n) <= f->double_ulps))) );
|
||||
if( fabsf( errp ) < fabsf(err ) )
|
||||
|
||||
@@ -633,7 +633,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d)
|
||||
double test = ((double*) q)[j];
|
||||
int correct2 = INT_MIN;
|
||||
long double correct = f->dfunc.f_fpI( s[j], &correct2 );
|
||||
float err = Ulp_Error_Double( test, correct );
|
||||
float err = Bruteforce_Ulp_Error_Double( test, correct );
|
||||
cl_long iErr = (long long) q2[j] - (long long) correct2;
|
||||
int fail = ! (fabsf(err) <= f->double_ulps && abs_cl_long( iErr ) <= maxiError );
|
||||
if( ftz )
|
||||
@@ -652,8 +652,8 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d)
|
||||
int correct5, correct6;
|
||||
long double correct3 = f->dfunc.f_fpI( 0.0, &correct5 );
|
||||
long double correct4 = f->dfunc.f_fpI( -0.0, &correct6 );
|
||||
float err2 = Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Ulp_Error_Double( test, correct4 );
|
||||
float err2 = Bruteforce_Ulp_Error_Double( test, correct3 );
|
||||
float err3 = Bruteforce_Ulp_Error_Double( test, correct4 );
|
||||
cl_long iErr2 = (long long) q2[j] - (long long) correct5;
|
||||
cl_long iErr3 = (long long) q2[j] - (long long) correct6;
|
||||
|
||||
|
||||
@@ -567,7 +567,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d)
|
||||
{
|
||||
double test = ((double*) q)[j];
|
||||
long double correct = f->dfunc.f_u( s[j] );
|
||||
float err = Ulp_Error_Double(test, correct);
|
||||
float err = Bruteforce_Ulp_Error_Double(test, correct);
|
||||
int fail = ! (fabsf(err) <= f->double_ulps);
|
||||
|
||||
// half_sin/cos/tan are only valid between +-2**16, Inf, NaN
|
||||
|
||||
Reference in New Issue
Block a user