[Piglit] [PATCH 1/2] genclbuiltins.py: Add a arguments for funtion gen.
Yi Sun
yi.sun at intel.com
Wed Oct 30 09:01:09 CET 2013
Via the new arg, we can configure the vector size while generating the test.cl.
For NOT disturbing previous test cases, set a default value.
Signed-off-by: Yi Sun <yi.sun at intel.com>
diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py
index 721191e..bdb18e9 100644
--- a/generated_tests/genclbuiltins.py
+++ b/generated_tests/genclbuiltins.py
@@ -332,7 +332,7 @@ def print_test(f, fnName, argType, functionDef, tests, testIdx, vecSize, tss):
f.write('\n')
-def gen(types, minVersions, functions, testDefs, dirName):
+def gen(types, minVersions, functions, testDefs, dirName, sizes=[]):
# Create the output directory if required
if not os.path.exists(dirName):
os.makedirs(dirName)
@@ -377,8 +377,10 @@ def gen(types, minVersions, functions, testDefs, dirName):
numTests = len(outputValues)
# Handle all available scalar/vector widths
- sizes = sorted(VEC_WIDTHS)
- sizes.insert(0, 1) # Add 1-wide scalar to the vector widths
+ if sizes == []:
+ sizes = sorted(VEC_WIDTHS)
+ sizes.insert(0, 1) # Add 1-wide scalar to the vector widths
+
for vecSize in sizes:
for testIdx in range(0, numTests):
print_test(f, fnName, dataType, functionDef, tests,
--
1.7.6.4
More information about the Piglit
mailing list