[Piglit] [PATCH 3/3] CL: Add some basic expm1 tests
Aaron Watry
awatry at gmail.com
Tue Jan 17 02:03:02 UTC 2017
These aren't too comprehensive, but there's some checks for reasonable accuracy
when the input is near 0.
Signed-off-by: Aaron Watry <awatry at gmail.com>
---
generated_tests/gen_cl_math_builtins.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/generated_tests/gen_cl_math_builtins.py b/generated_tests/gen_cl_math_builtins.py
index e9cfebf..f609d73 100644
--- a/generated_tests/gen_cl_math_builtins.py
+++ b/generated_tests/gen_cl_math_builtins.py
@@ -27,7 +27,7 @@ from __future__ import print_function, division, absolute_import
import os
from genclbuiltins import gen, NEGNAN
-from math import acos, acosh, asin, asinh, atan, atan2, atanh, cos, cosh, exp
+from math import acos, acosh, asin, asinh, atan, atan2, atanh, cos, cosh, e, exp
from math import fabs, fmod, log10, log1p, pi, pow, sin, sinh, sqrt, tan, tanh
CLC_VERSION_MIN = {
@@ -51,6 +51,7 @@ CLC_VERSION_MIN = {
'erf' : 10,
'erfc' : 10,
'exp' : 10,
+ 'expm1' : 10,
'fabs' : 10,
'fdim' : 10,
'floor' : 10,
@@ -266,6 +267,15 @@ tests = {
],
'tolerance' : 3
},
+ 'expm1' : {
+ 'arg_types' : [F, F],
+ 'function_type': 'ttt',
+ 'values' : [
+ [0.0, e-1.0, 1.00000000005e-10, 1e-16, float("inf"), exp(-pi)-1, float("nan") ], # Result
+ [0.0, 1.0, 1e-10, 1e-16, 710, -pi, float("nan")] # Arg0
+ ],
+ 'tolerance' : 3
+ },
'fabs' : {
'arg_types' : [F, F],
'function_type': 'ttt',
--
2.9.3
More information about the Piglit
mailing list