[Piglit] [PATCH 3/4] cl: Add fabs tests

Aaron Watry awatry at gmail.com
Thu Sep 4 10:30:20 PDT 2014


Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 generated_tests/generate-cl-math-builtins.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/generated_tests/generate-cl-math-builtins.py b/generated_tests/generate-cl-math-builtins.py
index 124acf6..0677569 100644
--- a/generated_tests/generate-cl-math-builtins.py
+++ b/generated_tests/generate-cl-math-builtins.py
@@ -25,7 +25,7 @@
 import os
 
 from genclbuiltins import gen
-from math import acos, asin, atan, atan2, pi, sin, sqrt, cos
+from math import acos, asin, atan, atan2, pi, sin, sqrt, cos, fabs
 
 CLC_VERSION_MIN = {
     'acos' : 10,
@@ -35,6 +35,7 @@ CLC_VERSION_MIN = {
     'ceil' : 10,
     'copysign' : 10,
     'cos' : 10,
+    'fabs' : 10,
     'floor' : 10,
     'mix' : 10,
     'nextafter' : 10,
@@ -115,6 +116,15 @@ tests = {
         ],
         'tolerance' : 2
     },
+    'fabs' : {
+        'arg_types' : [F, F],
+        'function_type': 'ttt',
+        'values' : [
+            [0.0, pi/2,  pi,  0.0, float("inf"),  float("inf"), 1.12345 ], # Result
+            [0.0, -pi/2, pi, -0.0, float("-inf"), float("inf"), -1.12345] # Arg0
+        ],
+        'tolerance' : 0
+    },
     'floor' : {
         'arg_types': [F, F],
         'function_type': 'ttt',
-- 
1.9.1



More information about the Piglit mailing list