[Piglit] [PATCH 3/3] cl: add atan2pi test

Jan Vesely jan.vesely at rutgers.edu
Fri Mar 27 07:24:15 PDT 2015


On Fri, 2015-03-27 at 11:13 +0000, Bruno Jimenez wrote:
> On Wed, 2015-03-25 at 13:33 -0400, Jan Vesely wrote:
> > tested on clover and intel ocl-sdk
> > 
> > Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> > ---
> >  generated_tests/gen_cl_math_builtins.py | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/generated_tests/gen_cl_math_builtins.py b/generated_tests/gen_cl_math_builtins.py
> > index d86b53a..59b7f18 100644
> > --- a/generated_tests/gen_cl_math_builtins.py
> > +++ b/generated_tests/gen_cl_math_builtins.py
> > @@ -39,6 +39,7 @@ CLC_VERSION_MIN = {
> >      'asinpi' : 10,
> >      'atan' : 10,
> >      'atan2' : 10,
> > +    'atan2pi' : 10,
> >      'atanh' : 10,
> >      'atanpi': 10,
> >      'cbrt' : 10,
> > @@ -153,6 +154,16 @@ tests = {
> >          ],
> >          'tolerance' : 6
> >       },
> > +    'atan2pi' : {
> > +        'arg_types' : [F, F, F],
> > +        'function_type': 'ttt',
> > +        'values' : [
> > +            [atan2(0.0, 0.0)/pi, atan2(1.2345, 10.0)/pi, atan2(35671470.0, 0.1)/pi], # Result
> > +            [0.0,             1.2345,              35671470.0            ], # Arg0
> > +            [0.0,             10.0,                0.1                   ]  # Arg1
> > +
> Hi,
> 
> If I remember correctly, atan2 also accepts negative imputs for x and y,
> and returns the correct angle (remember that tan(x) == tan(x + pi)).
> Should they be also tested?

I agree. This is just a simple adaptation of atan2 tests. There's also
additional edge case behavior described in 7.5.1 that should be tested
too.

jan

> 
> -Bruno
> 
> >         ],
> > +        'tolerance' : 6
> > +     },
> >      'atanh' : {
> >          'arg_types' : [F, F],
> >          'function_type': 'ttt',
> 
> 

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150327/f3ed1b52/attachment.sig>


More information about the Piglit mailing list