[Piglit] [PATCH 2/2] cl: Add erfc tests

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


Tested on Apple CL (10.9, CPU and GF9400m) to 1ULP.

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 2919768..7195d08 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 erf, fabs, fmod, log1p, pi, pow, sin, sinh, sqrt, tan, tanh
+from math import erf, erfc, fabs, fmod, log1p, pi, pow, sin, sinh, sqrt, tan, tanh
 
 CLC_VERSION_MIN = {
     'acos' : 10,
@@ -44,6 +44,7 @@ CLC_VERSION_MIN = {
     'cosh' : 10,
     'cospi' : 10,
     'erf' : 10,
+    'erfc' : 10,
     'fabs' : 10,
     'floor' : 10,
     'fmod' : 10,
@@ -194,6 +195,15 @@ tests = {
         ],
         'tolerance' : 16
     },
+    'erfc' : {
+        'arg_types' : [F, F],
+        'function_type': 'ttt',
+        'values' : [
+            [1.0, 0.95, 0.009995, 1.994999, 0.0, 0.0, 2.0], # 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