Hmm, I'm not sure this is totally correct.  We actually ran into this back
in June, and I believe the conclusion is that we should actually be using
nextafterf/nextafter for calculating the tolerances for a given ulp.

See the email thread that started with my first patch here:
http://lists.freedesktop.org/archives/piglit/2015-June/016238.html

--Aaron

On Sat, Aug 15, 2015 at 8:37 AM, Zoltan Gilian <[email protected]>
wrote:

> The uint ulp value is compared to the float diff instead of
> reinterpreting the ulp as float.
> ---
>  Note: I'm new to contributing to piglit, and I don't have commit access.
>  tests/util/piglit-util-cl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util-cl.c
> index 47e0c7a..b49665a 100644
> --- a/tests/util/piglit-util-cl.c
> +++ b/tests/util/piglit-util-cl.c
> @@ -80,7 +80,7 @@ piglit_cl_probe_floating(float value, float expect,
> uint32_t ulp)
>
>         diff = fabsf(value - expect);
>
> -       if(diff > ulp || isnan(value)) {
> +       if(diff > t.f || isnan(value)) {
>                 printf("Expecting %f (0x%x) with tolerance %f (%u ulps),
> but got %f (0x%x)\n",
>                        e.f, e.u, t.f, t.u, v.f, v.u);
>                 return false;
> --
> 2.4.6
>
> _______________________________________________
> Piglit mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to