diff options
author | Aaron Watry <awatry@gmail.com> | 2014-12-18 09:30:31 -0600 |
---|---|---|
committer | Aaron Watry <awatry@gmail.com> | 2015-02-12 16:53:40 -0600 |
commit | 5431f5d4b4b74a636819e2d6d70031c01112cf57 (patch) | |
tree | 90c59a9dc0e8ffa1622813c0942d1a5e004c927e | |
parent | 0060f5998a181ed8001f087c6d329b0f821dc260 (diff) |
CL: Add support for generating double-precision tests
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@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
-rw-r--r-- | generated_tests/genclbuiltins.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py index 7e85a5174..9a8e85e8f 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) |