[Piglit] [PATCH] CL: Add support for generating double-precision tests

Tom Stellard tom at stellard.net
Thu Feb 12 07:58:44 PST 2015


On Thu, Feb 12, 2015 at 09:31:11AM -0600, Aaron Watry wrote:
> Ping.  I just realized that I had this sitting around in my local
> repository and never got any review (yay for the holidays causing things to
> get lost).
> 

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

> --Aaron
> 
> On Wed, Dec 17, 2014 at 10:52 PM, Aaron Watry <awatry at gmail.com> wrote:
> 
> > The tests are skipped for devices that don't support doubles, and
> > when the primary data type for a file is double, we enable the cl_khr_fp64
> > pragma
> > before writing any kernels.
> >
> > Signed-off-by: Aaron Watry <awatry at gmail.com>
> > ---
> >  generated_tests/genclbuiltins.py | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/generated_tests/genclbuiltins.py
> > b/generated_tests/genclbuiltins.py
> > index 7e85a51..9a8e85e 100644
> > --- a/generated_tests/genclbuiltins.py
> > +++ b/generated_tests/genclbuiltins.py
> > @@ -395,8 +395,13 @@ def gen(types, minVersions, functions, testDefs,
> > dirName):
> >                      '[config]\n' +
> >                      'name: Test '+dataType+' '+fnName+' built-in on CL
> > 1.1\n' +
> >                      'clc_version_min: '+str(clcVersionMin)+'\n' +
> > -                    'dimensions: 1\n\n'
> > +                    'dimensions: 1\n'
> >              )
> > +            if (dataType == 'double'):
> > +                f.write('require_device_extensions: cl_khr_fp64\n')
> > +
> > +            # Blank line  to provide separation between config header and
> > tests
> > +            f.write('\n')
> >
> >              # Write all tests for the built-in function
> >              tests = functionDef['values']
> > @@ -416,6 +421,9 @@ def gen(types, minVersions, functions, testDefs,
> > dirName):
> >              # Terminate the header section
> >              f.write('!*/\n\n')
> >
> > +            if (dataType == 'double'):
> > +                f.write('#pragma OPENCL EXTENSION cl_khr_fp64 :
> > enable\n\n')
> > +
> >              # Generate the actual kernels
> >              generate_kernels(f, dataType, fnName, functionDef)
> >
> > --
> > 2.2.0
> >
> >

> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



More information about the Piglit mailing list