[Piglit] [PATCH 1/2] cl: Add some erf builtin tests

Aaron Watry awatry at gmail.com
Fri Oct 24 05:49:38 PDT 2014


Tested on Apple CL (CPU and GF9400m) down to 1 ULP precision, but
the spec says 16ULP.

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 cc9b60b..2919768 100644
--- a/generated_tests/generate-cl-math-builtins.py
+++ b/generated_tests/generate-cl-math-builtins.py
@@ -27,7 +27,7 @@ import os
 
 from genclbuiltins import gen, NEGNAN
 from math import acos, acosh, asin, asinh, atan, atan2, atanh, cos, cosh
-from math import fabs, fmod, log1p, pi, pow, sin, sinh, sqrt, tan, tanh
+from math import erf, fabs, fmod, log1p, pi, pow, sin, sinh, sqrt, tan, tanh
 
 CLC_VERSION_MIN = {
     'acos' : 10,
@@ -43,6 +43,7 @@ CLC_VERSION_MIN = {
     'cos' : 10,
     'cosh' : 10,
     'cospi' : 10,
+    'erf' : 10,
     'fabs' : 10,
     'floor' : 10,
     'fmod' : 10,
@@ -184,6 +185,15 @@ tests = {
         ],
         'tolerance' : 4
     },
+    'erf' : {
+        'arg_types' : [F, F],
+        'function_type': 'ttt',
+        'values' : [
+            [0.0, 0.950004,        0.990005,        -0.994999475,  0.27219439321703e-29, 1, -1], # Result
+            [0.0, 1.960/sqrt(2.0), 2.576/sqrt(2.0), -2.807/sqrt(2.0), 11.1, float("inf"), float("-inf")]  # Arg0
+        ],
+        'tolerance' : 16
+    },
     'fabs' : {
         'arg_types' : [F, F],
         'function_type': 'ttt',
-- 
2.1.1



More information about the Piglit mailing list