[Beignet] [PATCH 2/2] utest_generator.py: add OCL_STRICT_CONFORMANCE enviroment condition.
Sun, Yi
yi.sun at intel.com
Mon Jun 23 06:00:50 PDT 2014
Ok, nice modification, thanks Zhigang.
Thanks
--Sun, Yi
> -----Original Message-----
> From: Zhigang Gong [mailto:zhigang.gong at linux.intel.com]
> Sent: Monday, June 23, 2014 5:02 PM
> To: Sun, Yi
> Cc: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH 2/2] utest_generator.py: add
> OCL_STRICT_CONFORMANCE enviroment condition.
>
> Yi,
>
> I already fixed the issue in this patch and pushed the modified version.
> Thanks for the patch.
>
> On Mon, Jun 23, 2014 at 10:51:33AM +0800, Zhigang Gong wrote:
> > On Mon, Jun 23, 2014 at 08:56:33AM +0800, Yi Sun wrote:
> > > For auto-generated math cases, when OCL_STRICT_CONFORMANCE is set,
> > > the expected diff increases to 0.001
> > >
> > > Signed-off-by: Yi Sun <yi.sun at intel.com>
> > >
> > > diff --git a/utests/utest_generator.py b/utests/utest_generator.py
> > > index 94900d9..37473d7 100644
> > > --- a/utests/utest_generator.py
> > > +++ b/utests/utest_generator.py
> > > @@ -21,6 +21,8 @@ def udebug(ulpSize,returnType):
> > > text='''
> > > static const char* INFORNAN;
> > > static %s ULPSIZE;
> > > +
> > > + const char* env_strict = getenv("OCL_STRICT_CONFORMANCE");
> > >
> > > if (isinf(cpu_data[index])){
> > > INFORNAN="INF";
> > > @@ -32,6 +34,9 @@ def udebug(ulpSize,returnType):
> > > ULPSIZE=cl_%s(cpu_data[index]) * %s;
> > > }
> > >
> > > + if ( strcmp(env_strict, "0") == 0)
> > > + ULPSIZE = 0.01;
> > Set ULPSIZE to a fixed value is not correct. You still need to consider the
> target result.
> > If the target result is 1e20, then 0.01 will be an impossible accuracy
> > diff even with full double precision support.
> >
> > > +
> > > #if udebug
> > > if (isinf(cpu_data[index])){
> > > if (isinf(gpu_data[index]))
> > > @@ -128,6 +133,7 @@ which can print more values and information to
> assist debuging the issue.
> > > #include <stdio.h>
> > > #include <math.h>
> > > #include <algorithm>
> > > +#include <string.h>
> > >
> > > #define udebug 0
> > > #define FLT_MAX 0x1.fffffep127f
> > > --
> > > 1.8.5.3
> > >
> > > _______________________________________________
> > > Beignet mailing list
> > > Beignet at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/beignet
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list