[Piglit] [PATCH 2/2 v2] The return code of the function isnan is -1 for vector types.

Sun, Yi yi.sun at intel.com
Fri Nov 1 02:33:14 CET 2013


Hi Tom,

Actually, I'm not sure if we can have two test under the same function name 'isnan'. The case maybe look like the following?
tests = {
    'isnan' : {
        'arg_types': [I, F],
        'function_type': 'vvv',
        'values': [
            [0,   -1,            0,   0],            # Result
            [0.0, float("nan"), 1.0, float("inf") ] # Arg0
        ]
        'arg_tpyes':[I,F],
        'function_type': 'sss',
        'values': [
            [0,   1,            0,   0],            # Result
            [0.0, float("nan"), 1.0, float("inf") ] # Arg0
        ]        
    }
}

It seems the existing genclbuiltin.py cannot do like this, or I'm a little dull.
So could you have some good idea?

Thanks
  --Sun, Yi

> -----Original Message-----
> From: Tom Stellard [mailto:tom at stellard.net]
> Sent: Friday, November 1, 2013 12:25 AM
> To: Sun, Yi
> Cc: piglit at lists.freedesktop.org; baker.dylan.c at gmail.com
> Subject: Re: [PATCH 2/2 v2] The return code of the function isnan is -1 for vector
> types.
> 
> On Fri, Nov 01, 2013 at 12:20:47AM +0800, Yi Sun wrote:
> > According to the OpenCL spec version 1.2/1.1 chacpter 6.12.6:
> > The functions isequal, isnotequal, isgreater, isgreaterequal, isless,
> > islessequal, islessgreater, isfinite, isinf, isnan, isnormal,
> > isordered, isunordered and signbit described in table 6.14 shall
> > return a 0 if the specified relation is false and a 1 if the specified
> > relation is true for scalar argument types. These functions shall
> > return a 0 if the specified relation is false and a ???1 (i.e. all
> > bits set) if the specified relation is true for vector argument types.
> >
> > Signed-off-by: Yi Sun <yi.sun at intel.com>
> >
> > diff --git a/generated_tests/generate-cl-relational-builtins.py
> > b/generated_tests/generate-cl-relational-builtins.py
> > old mode 100644
> > new mode 100755
> > index af6849f..457c5bc
> > --- a/generated_tests/generate-cl-relational-builtins.py
> > +++ b/generated_tests/generate-cl-relational-builtins.py
> > @@ -45,9 +45,9 @@ I = {
> >  tests = {
> >      'isnan' : {
> >          'arg_types': [I, F],
> > -        'function_type': 'ttt',
> > +        'function_type': 'vvv',
> >          'values': [
> > -            [0,   1,            0,   0],            # Result
> > +            [0,   -1,            0,   0],            # Result
> >              [0.0, float("nan"), 1.0, float("inf") ] # Arg0
> >          ]
> 
> Did you forget to add a 'sss' variant of this test?
> 
> -Tom
> 
> >      }
> > --
> > 1.7.6.4
> >


More information about the Piglit mailing list