Reuse math_brute_force ulp threshold in spir test

Spir test compares floating-point kernel results bit-by-bit with
correct results. However, for math_brute_force kernels, specification
does not ask for SPIR and OpenCL C path to match bit-to-bit. This patch
reuses ulps threshold from math_brute_force folder for math_brute_force
kernels in spir test.

Signed-off-by: Wenju He <wenju.he@intel.com>
This commit is contained in:
Wenju He
2019-04-12 11:21:07 +08:00
committed by Alastair Murray
parent b5028806d8
commit 1de46f2ca1
7 changed files with 130 additions and 16 deletions

View File

@@ -746,7 +746,7 @@ void run_kernel( cl_kernel kernel, cl_command_queue queue, WorkSizeInfo &ws, Tes
/**
Compare two test results
*/
bool compare_results( const TestResult& lhs, const TestResult& rhs )
bool compare_results( const TestResult& lhs, const TestResult& rhs, float ulps )
{
if( lhs.kernelArgs().getArgCount() != rhs.kernelArgs().getArgCount() )
{
@@ -756,7 +756,7 @@ bool compare_results( const TestResult& lhs, const TestResult& rhs )
for( size_t i = 0 ; i < lhs.kernelArgs().getArgCount(); ++i )
{
if( ! lhs.kernelArgs().getArg(i)->compare( *rhs.kernelArgs().getArg(i)) )
if( ! lhs.kernelArgs().getArg(i)->compare( *rhs.kernelArgs().getArg(i), ulps ) )
{
log_error("the kernel parameter (%d) is different between SPIR and CL version of the kernel\n", i);
return false;