Re: [Piglit] [PATCH] Use right comparison function for double
On Wed, 2016-08-24 at 20:19 +0100, Ian Romanick wrote: > The subject line should be tagged "cl:" so that people know it's an > OpenCL related patch. I added the prefix before pushing. Jan > > On 08/24/2016 05:33 AM, arse...@gmail.com wrote: > > > > From: Matt Arsenault > > > > --- > > tests/cl/program/program-tester.c | 12 ++-- > > tests/util/piglit-util-cl.c | 2 +- > > 2 files changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/tests/cl/program/program-tester.c > > b/tests/cl/program/program-tester.c > > index 25b677f..1a87610 100644 > > --- a/tests/cl/program/program-tester.c > > +++ b/tests/cl/program/program-tester.c > > @@ -2115,14 +2115,14 @@ check_test_arg_value(struct test_arg > > test_arg, > > } > > \ > > } > > \ > > return true; > > -#define CASEF(enum_type, type, > > cl_type) \ > > +#define CASEF(enum_type, type, cl_type, testfn) > > \ > > case > > enum_type: > > \ > > for(i = 0; i < test_arg.length; i++) > > { \ > > for(c = 0; c < test_arg.cl_size; c++) > > { \ > > rb = i*test_arg.cl_mem_size + > > c; \ > > - if(!piglit_cl_probe_floating(((cl_ > > type*)value)[rb], \ > > - ((cl_ > > type*)test_arg.value)[rb], \ > > - test_ > > arg.ulp)) { \ > > + if(!testfn(((cl_type*)value)[rb], > > \ > > + ((cl_type*)test_arg.val > > ue)[rb], \ > > + test_arg.ulp)) > > {\ > > ra = i*test_arg.cl_size + > > c; \ > > printf("Error at > > %s[%zu]\n", type, ra); \ > > return > > false;\ > > @@ -2141,8 +2141,8 @@ check_test_arg_value(struct test_arg > > test_arg, > > CASEI(TYPE_LONG, "long", cl_long) > > CASEU(TYPE_ULONG, "ulong", cl_ulong) > > CASEH(TYPE_HALF, "half", cl_half) > > - CASEF(TYPE_FLOAT, "float", cl_float) > > - CASEF(TYPE_DOUBLE, "double", cl_double) > > + CASEF(TYPE_FLOAT, "float", cl_float, > > piglit_cl_probe_floating) > > + CASEF(TYPE_DOUBLE, "double", cl_double, > > piglit_cl_probe_double) > > } > > > > #undef CASEF > > diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util- > > cl.c > > index fb32fee..dba3263 100644 > > --- a/tests/util/piglit-util-cl.c > > +++ b/tests/util/piglit-util-cl.c > > @@ -130,7 +130,7 @@ piglit_cl_probe_double(double value, double > > expect, uint64_t ulp) > > diff = fabsl(value - expect); > > > > if(diff > ulp || isnan(value)) { > > - printf("Expecting %f (0x%lx) with tolerance %f > > (%lu ulps), but got %f (0x%lx)\n", > > + printf("Expecting %f (0x%" PRIx64") with tolerance > > %f (%lu ulps), but got %f (0x%" PRIx64")\n", > > e.f, e.u, t.f, t.u, v.f, v.u); > > return false; > > } > > > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Use right comparison function for double
On Wed, 2016-08-24 at 12:16 -0700, Matt Arsenault wrote: > > > > On Aug 24, 2016, at 08:11, Jan Vesely > u> wrote: > > > > On Tue, 2016-08-23 at 21:33 -0700, arse...@gmail.com wrote: > > > > > > From: Matt Arsenault > > > > I guess more cases can be consolidated this way... > > > > Reviewed-by: Jan Vesely > > > > Jan > > > > I need someone to commit this for me pushed. Jan ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Use right comparison function for double
The subject line should be tagged "cl:" so that people know it's an OpenCL related patch. On 08/24/2016 05:33 AM, arse...@gmail.com wrote: > From: Matt Arsenault > > --- > tests/cl/program/program-tester.c | 12 ++-- > tests/util/piglit-util-cl.c | 2 +- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/tests/cl/program/program-tester.c > b/tests/cl/program/program-tester.c > index 25b677f..1a87610 100644 > --- a/tests/cl/program/program-tester.c > +++ b/tests/cl/program/program-tester.c > @@ -2115,14 +2115,14 @@ check_test_arg_value(struct test_arg test_arg, > } > \ > } > \ > return true; > -#define CASEF(enum_type, type, cl_type) > \ > +#define CASEF(enum_type, type, cl_type, testfn) > \ > case enum_type: > \ > for(i = 0; i < test_arg.length; i++) { > \ > for(c = 0; c < test_arg.cl_size; c++) { > \ > rb = i*test_arg.cl_mem_size + c; > \ > - > if(!piglit_cl_probe_floating(((cl_type*)value)[rb], \ > - > ((cl_type*)test_arg.value)[rb], \ > - test_arg.ulp)) { > \ > + if(!testfn(((cl_type*)value)[rb], \ > +((cl_type*)test_arg.value)[rb], \ > +test_arg.ulp)) {\ > ra = i*test_arg.cl_size + c; > \ > printf("Error at %s[%zu]\n", type, ra); > \ > return false; > \ > @@ -2141,8 +2141,8 @@ check_test_arg_value(struct test_arg test_arg, > CASEI(TYPE_LONG, "long", cl_long) > CASEU(TYPE_ULONG, "ulong", cl_ulong) > CASEH(TYPE_HALF, "half", cl_half) > - CASEF(TYPE_FLOAT, "float", cl_float) > - CASEF(TYPE_DOUBLE, "double", cl_double) > + CASEF(TYPE_FLOAT, "float", cl_float, piglit_cl_probe_floating) > + CASEF(TYPE_DOUBLE, "double", cl_double, > piglit_cl_probe_double) > } > > #undef CASEF > diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util-cl.c > index fb32fee..dba3263 100644 > --- a/tests/util/piglit-util-cl.c > +++ b/tests/util/piglit-util-cl.c > @@ -130,7 +130,7 @@ piglit_cl_probe_double(double value, double expect, > uint64_t ulp) > diff = fabsl(value - expect); > > if(diff > ulp || isnan(value)) { > - printf("Expecting %f (0x%lx) with tolerance %f (%lu ulps), but > got %f (0x%lx)\n", > + printf("Expecting %f (0x%" PRIx64") with tolerance %f (%lu > ulps), but got %f (0x%" PRIx64")\n", > e.f, e.u, t.f, t.u, v.f, v.u); > return false; > } > ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Use right comparison function for double
> On Aug 24, 2016, at 08:11, Jan Vesely wrote: > > On Tue, 2016-08-23 at 21:33 -0700, arse...@gmail.com wrote: >> From: Matt Arsenault > > I guess more cases can be consolidated this way... > > Reviewed-by: Jan Vesely > > Jan > I need someone to commit this for me ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Use right comparison function for double
On Tue, 2016-08-23 at 21:33 -0700, arse...@gmail.com wrote: > From: Matt Arsenault I guess more cases can be consolidated this way... Reviewed-by: Jan Vesely Jan > > --- > tests/cl/program/program-tester.c | 12 ++-- > tests/util/piglit-util-cl.c | 2 +- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/tests/cl/program/program-tester.c > b/tests/cl/program/program-tester.c > index 25b677f..1a87610 100644 > --- a/tests/cl/program/program-tester.c > +++ b/tests/cl/program/program-tester.c > @@ -2115,14 +2115,14 @@ check_test_arg_value(struct test_arg > test_arg, > } > \ > } > \ > return true; > -#define CASEF(enum_type, type, > cl_type) \ > +#define CASEF(enum_type, type, cl_type, testfn) > \ > case > enum_type: \ > for(i = 0; i < test_arg.length; i++) > { \ > for(c = 0; c < test_arg.cl_size; c++) > { \ > rb = i*test_arg.cl_mem_size + > c; \ > - if(!piglit_cl_probe_floating(((cl_ty > pe*)value)[rb], \ > - ((cl_ty > pe*)test_arg.value)[rb], \ > - test_ar > g.ulp)) { \ > + if(!testfn(((cl_type*)value)[rb], > \ > + ((cl_type*)test_arg.value > )[rb], \ > + test_arg.ulp)) > {\ > ra = i*test_arg.cl_size + > c; \ > printf("Error at %s[%zu]\n", > type, ra); \ > return > false;\ > @@ -2141,8 +2141,8 @@ check_test_arg_value(struct test_arg test_arg, > CASEI(TYPE_LONG, "long", cl_long) > CASEU(TYPE_ULONG, "ulong", cl_ulong) > CASEH(TYPE_HALF, "half", cl_half) > - CASEF(TYPE_FLOAT, "float", cl_float) > - CASEF(TYPE_DOUBLE, "double", cl_double) > + CASEF(TYPE_FLOAT, "float", cl_float, > piglit_cl_probe_floating) > + CASEF(TYPE_DOUBLE, "double", cl_double, > piglit_cl_probe_double) > } > > #undef CASEF > diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util- > cl.c > index fb32fee..dba3263 100644 > --- a/tests/util/piglit-util-cl.c > +++ b/tests/util/piglit-util-cl.c > @@ -130,7 +130,7 @@ piglit_cl_probe_double(double value, double > expect, uint64_t ulp) > diff = fabsl(value - expect); > > if(diff > ulp || isnan(value)) { > - printf("Expecting %f (0x%lx) with tolerance %f (%lu > ulps), but got %f (0x%lx)\n", > + printf("Expecting %f (0x%" PRIx64") with tolerance > %f (%lu ulps), but got %f (0x%" PRIx64")\n", > e.f, e.u, t.f, t.u, v.f, v.u); > return false; > } signature.asc Description: This is a digitally signed message part ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit