[Piglit] [PATCH 2/3] cl: Add sqrt tests

Aaron Watry awatry at gmail.com
Fri Aug 29 15:37:23 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 dfcad50..11882d4 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 atan, pi, sin, cos
+from math import atan, pi, sin, sqrt, cos
 
 CLC_VERSION_MIN = {
     'atan' : 10,
@@ -37,6 +37,7 @@ CLC_VERSION_MIN = {
     'round' : 10,
     'sign' : 10,
     'sin' : 10,
+    'sqrt' : 10,
     'trunc' : 10
 }
 
@@ -126,6 +127,15 @@ tests = {
         ],
         'tolerance': 2
     },
+    'sqrt' : {
+        'arg_types': [F, F],
+        'function_type': 'ttt',
+        'values': [
+            [1.0, 2.0,  6.0, 2.5 , float("nan"), 4.0,  sqrt(0.0), sqrt(7.0), sqrt(pi)], # Result
+            [1.0, 4.0, 36.0, 6.25, float("nan"), 16.0, 0.0, 7.0, pi], # Arg1
+        ],
+        'tolerance': 3
+    },
     'trunc' : {
         'arg_types': [F, F],
         'function_type': 'ttt',
-- 
1.9.1



More information about the Piglit mailing list