summaryrefslogtreecommitdiff
path: root/generated_tests/genclbuiltins.py
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-07-23 13:45:32 -0400
committerTom Stellard <thomas.stellard@amd.com>2014-07-23 13:45:32 -0400
commit7385ab123927222b1a832d09d1aacea12a53eee2 (patch)
treebac8172bffbfbd294485d6ba8f888f131850c995 /generated_tests/genclbuiltins.py
parent62085cbe9fe9451b0854858b79f152924f775847 (diff)
genclbuiltins: Only use ulp tolerance for float types
Diffstat (limited to 'generated_tests/genclbuiltins.py')
-rw-r--r--generated_tests/genclbuiltins.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py
index da4af5a9a..eaf953284 100644
--- a/generated_tests/genclbuiltins.py
+++ b/generated_tests/genclbuiltins.py
@@ -284,6 +284,8 @@ def getArgTypes(baseType, argTypes):
ret.append(getArgType(baseType, argType))
return ret
+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, testIdx, vecSize, tss):
@@ -330,7 +332,10 @@ def print_test(f, fnName, argType, functionDef, tests, testIdx, vecSize, tss):
'[' + str(vecSize) + '] ' + ' '.join([argVal]*vecSize)
)
if arg == 0:
- f.write(' tolerance {} ulp'.format(tolerance))
+ f.write(' tolerance {} '.format(tolerance))
+ # Use ulp tolerance for float types
+ if isFloatType(argTypes[arg]):
+ f.write('ulp')
f.write('\n')
else:
argInOut = 'arg_in: '