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

Aaron Watry awatry at gmail.com
Thu Feb 12 07:31:11 PST 2015


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).

--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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150212/c8bd2503/attachment-0001.html>


More information about the Piglit mailing list