[Piglit] [PATCH v3 1/1] cl: Add copysign tests

Jan Vesely jan.vesely at rutgers.edu
Tue Sep 9 16:34:19 PDT 2014


v2: Fix -NaN test
v3: Rebase

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 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 11105a5..fcdcc94 100644
--- a/generated_tests/generate-cl-math-builtins.py
+++ b/generated_tests/generate-cl-math-builtins.py
@@ -24,7 +24,7 @@
 
 import os
 
-from genclbuiltins import gen
+from genclbuiltins import gen, NEGNAN
 from math import acos, asin, atan, atan2, fmod, pi, sin, sqrt, cos, fabs, tan, pow
 
 CLC_VERSION_MIN = {
@@ -33,6 +33,7 @@ CLC_VERSION_MIN = {
     'atan' : 10,
     'atan2' : 10,
     'ceil' : 10,
+    'copysign' : 10,
     'cos' : 10,
     'fabs' : 10,
     'floor' : 10,
@@ -99,6 +100,15 @@ tests = {
             [0.5, -0.5, 0.0, -0.0, float("nan"), -3.99]
         ]
     },
+    'copysign' : {
+        'arg_types': [F, F, F],
+        'function_type': 'ttt',
+        'values': [
+            [0.0, -0.0, 1.0, -1.0, float("nan"), float("nan"), NEGNAN,       float("-inf"), float("inf") ], # Result
+            [0.0,  0.0, 1.0, -1.0, float("nan"), -4.0,         float("nan"), float("inf"),  float("-inf") ], # Arg0
+            [1.0, -1.0, 2.0, -2.0, float("nan"), float("nan"), -4.0,         -3.0,          float("inf") ], # Arg1
+        ]
+    },
     'cos' : {
         'arg_types' : [F, F],
         'function_type': 'ttt',
-- 
1.9.3



More information about the Piglit mailing list