[Piglit] [PATCH 1/2] cl: Add some erf builtin tests
Aaron Watry
awatry at gmail.com
Tue Oct 28 05:49:53 PDT 2014
No, you're not missing anything. I had originally imported the
functions when working on these tests with the intention to use
them... Then I just wrote in the expected results in the tests
without calling the functions (I'm occasionally wary that we're
trusting python's math lib to give us what we are treating as the
one-true-result).
Of course if python, intel-ocl, Apple CPU and the Apple GPU (Nvidia
GF9400) all agree on the answer, then we're probably good for now.
I'll remove the import statements before pushing. If someone else
wants to use them in the future, it's easy enough to add them back in.
--Aaron
On Fri, Oct 24, 2014 at 10:07 AM, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> On Fri, 2014-10-24 at 07:49 -0500, Aaron Watry wrote:
>> 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
> you import erf ^^^^
> but don't use it, am I missing something?
>
> same for the 2/2
>
> otherwise both lgtm
> i tested on intel-ocl too
>
> jan
>
>>
>> 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',
>
> --
> Jan Vesely <jan.vesely at rutgers.edu>
More information about the Piglit
mailing list