summaryrefslogtreecommitdiff
path: root/generated_tests/genclbuiltins.py
diff options
context:
space:
mode:
authorAaron Watry <awatry@gmail.com>2014-06-20 11:14:10 -0500
committerAaron Watry <awatry@gmail.com>2014-06-20 14:33:13 -0500
commita166fc6ccfb6244a5e260ddcef44e6f419721d9e (patch)
tree940d7512c9fc484290e2a27da9b5a87e2922cc4d /generated_tests/genclbuiltins.py
parent21b355e330b847efa7ee51a5b87ba7c1aa58620c (diff)
cl: Add signbit(float) relational tests
Also, while doing this, needed to add a NEGNAN define to genclbuiltins.py because python just prints nan for float("-nan") when generating tests. cl-program-tester can handle -nan as an input correctly, so just pass the value through as a string without python attempting to handle it. v2: Add nan and -nan tests Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> CC: Tom Stellard <thomas.stellard@amd.com>
Diffstat (limited to 'generated_tests/genclbuiltins.py')
-rw-r--r--generated_tests/genclbuiltins.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/generated_tests/genclbuiltins.py b/generated_tests/genclbuiltins.py
index 2d2b32266..9173cdbb5 100644
--- a/generated_tests/genclbuiltins.py
+++ b/generated_tests/genclbuiltins.py
@@ -56,6 +56,7 @@ UMAX = 'unsigned_max_for_type'
TYPE = 'TYPE'
SIZE = 'SIZE'
TRUE = 'true_value_for_type' #1 for scalar, -1 for vector
+NEGNAN = 'Negative NAN as a string, because float("-nan") just produces nan'
# Identity type list
T = {
@@ -234,6 +235,8 @@ def getValue(type, val, isVector):
return -1
else:
return 1
+ elif (val == NEGNAN):
+ return '-nan' #cl-program-tester translates this for us
else:
print('Unknown string value: ' + val + '\n')
elif (isinstance(val, list)):