summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2015-04-11 20:19:42 -0400
committerJan Vesely <jan.vesely@rutgers.edu>2015-04-20 16:59:41 -0400
commit64ea3b50b042879c7c55729997cc4cdad1fe22bd (patch)
tree53051ed2ae906411caa517359d54072f5248e16e
parent24104ea2ce1e35b183d08b145c83ea620008c100 (diff)
cl: Fix generating tts tests
That's just 'mix' at this moment Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
-rw-r--r--generated_tests/genclbuiltins.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py
index cf95f9c51..24bf24976 100644
--- a/generated_tests/genclbuiltins.py
+++ b/generated_tests/genclbuiltins.py
@@ -302,22 +302,20 @@ def isFloatType(t):
return t not in U
# Print a test with all-vector inputs/outputs and/or mixed vector/scalar args
-def print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, tss):
+def print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, fntype):
# If the test allows mixed vector/scalar arguments, handle the case with
# only vector arguments through a recursive call.
- if (tss):
+ if (fntype is 'tss' or fntype is 'tts'):
print_test(f, fnName, argType, functionDef, tests, numTests, vecSize,
- False)
+ 'ttt')
# The tss && vecSize==1 case is handled in the non-tss case.
- if (tss and vecSize == 1):
+ if ((not fntype is 'ttt') and vecSize == 1):
return
# If we're handling mixed vector/scalar input widths, the kernels have
# different names than when the vector widths match
- tssStr = 'tss_'
- if (not tss):
- tssStr = ''
+ tssStr = fntype + '_' if (not fntype is 'ttt') else ''
argTypes = getArgTypes(argType, functionDef['arg_types'])
argCount = len(argTypes)
@@ -342,7 +340,7 @@ def print_test(f, fnName, argType, functionDef, tests, numTests, vecSize, tss):
# The output argument and first tss argument are vectors, any that
# follow are scalar. If !tss, then everything has a matching vector
# width
- if (arg < 2 or not tss):
+ if (fntype is 'ttt' or (arg < 2 and fntype is 'tss') or (arg < 3 and fntype is 'tts')):
f.write(argInOut + str(arg) + ' buffer ' + argTypes[arg] +
'[' + str(numTests * vecSize) + '] ' +
''.join(map(lambda x: (x + ' ') * vecSize, argVal.split()))
@@ -421,7 +419,7 @@ def gen(types, minVersions, functions, testDefs, dirName):
sizes.insert(0, 1) # Add 1-wide scalar to the vector widths
for vecSize in sizes:
print_test(f, fnName, dataType, functionDef, tests,
- numTests, vecSize, (fnType is 'tss'))
+ numTests, vecSize, fnType)
# Terminate the header section
f.write('!*/\n\n')