mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 23:09:01 +00:00
Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github. This commit contains all the changes that have been done in Gitlab since the first public release of the conformance tests. Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
@@ -233,6 +233,7 @@ typedef struct TestInfo
|
||||
cl_kernel *k[VECTOR_SIZE_COUNT ]; // arrays of thread-specific kernels for each worker thread: k[vector_size][thread_id]
|
||||
ThreadInfo *tinfo; // An array of thread specific information for each worker thread
|
||||
cl_uint threadCount; // Number of worker threads
|
||||
cl_uint jobCount; // Number of jobs
|
||||
cl_uint step; // step between each chunk and the next.
|
||||
cl_uint scale; // stride between individual test values
|
||||
float ulps; // max_allowed ulps
|
||||
@@ -268,6 +269,16 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter)
|
||||
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
|
||||
}
|
||||
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
|
||||
if (test_info.step / test_info.subBufferSize != test_info.scale)
|
||||
{
|
||||
//there was overflow
|
||||
test_info.jobCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
test_info.jobCount = (cl_uint)((1ULL << 32) / test_info.step);
|
||||
}
|
||||
|
||||
test_info.f = f;
|
||||
test_info.ulps = gIsEmbedded ? f->float_embedded_ulps : f->float_ulps;
|
||||
test_info.ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities);
|
||||
@@ -341,7 +352,7 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter)
|
||||
// Run the kernels
|
||||
if( !gSkipCorrectnessTesting )
|
||||
{
|
||||
error = ThreadPool_Do( TestFloat, (cl_uint) ((1ULL<<32) / test_info.step), &test_info );
|
||||
error = ThreadPool_Do( TestFloat, test_info.jobCount, &test_info );
|
||||
|
||||
// Accumulate the arithmetic errors
|
||||
for( i = 0; i < test_info.threadCount; i++ )
|
||||
@@ -991,6 +1002,16 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafte
|
||||
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
|
||||
}
|
||||
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
|
||||
if (test_info.step / test_info.subBufferSize != test_info.scale)
|
||||
{
|
||||
//there was overflow
|
||||
test_info.jobCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
test_info.jobCount = (cl_uint)((1ULL << 32) / test_info.step);
|
||||
}
|
||||
|
||||
test_info.f = f;
|
||||
test_info.ulps = f->double_ulps;
|
||||
test_info.ftz = f->ftz || gForceFTZ;
|
||||
@@ -1063,7 +1084,7 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d, int isNextafte
|
||||
|
||||
if( !gSkipCorrectnessTesting )
|
||||
{
|
||||
error = ThreadPool_Do( TestDouble, (cl_uint) ((1ULL<<32) / test_info.step), &test_info );
|
||||
error = ThreadPool_Do( TestDouble, test_info.jobCount, &test_info );
|
||||
|
||||
// Accumulate the arithmetic errors
|
||||
for( i = 0; i < test_info.threadCount; i++ )
|
||||
@@ -1359,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 )
|
||||
@@ -1399,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;
|
||||
@@ -1422,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 ) )
|
||||
@@ -1451,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;
|
||||
|
||||
Reference in New Issue
Block a user