<div dir="ltr"><div>Meh, this still feels broken.  Give me a bit longer.<br><br></div>--Aaron<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 13, 2015 at 2:28 PM, Aaron Watry <span dir="ltr"><<a href="mailto:awatry@gmail.com" target="_blank">awatry@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We need to actually check against the float value from the union,<br>
instead of just doing (diff > ulp), which seems to cast the diff to<br>
an int before checking against ulp.<br>
<br>
Signed-off-by: Aaron Watry <<a href="mailto:awatry@gmail.com">awatry@gmail.com</a>><br>
CC: Tom Stellard <<a href="mailto:thomas.stellard@amd.com">thomas.stellard@amd.com</a>><br>
CC: Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu">jan.vesely@rutgers.edu</a>><br>
---<br>
 tests/util/piglit-util-cl.c | 28 ++++++++++++++--------------<br>
 1 file changed, 14 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util-cl.c<br>
index 47e0c7a..6cdd718 100644<br>
--- a/tests/util/piglit-util-cl.c<br>
+++ b/tests/util/piglit-util-cl.c<br>
@@ -80,7 +80,7 @@ piglit_cl_probe_floating(float value, float expect,  uint32_t ulp)<br>
<br>
        diff = fabsf(value - expect);<br>
<br>
-       if(diff > ulp || isnan(value)) {<br>
+       if (diff > t.f || isnan(value)) {<br>
                printf("Expecting %f (0x%x) with tolerance %f (%u ulps), but got %f (0x%x)\n",<br>
                       e.f, e.u, t.f, t.u, v.f, v.u);<br>
                return false;<br>
@@ -108,7 +108,7 @@ piglit_cl_probe_double(double value, double expect, uint64_t ulp)<br>
<br>
        diff = fabsl(value - expect);<br>
<br>
-       if(diff > ulp || isnan(value)) {<br>
+       if (diff > t.f || isnan(value)) {<br>
                printf("Expecting %f (0x%lx) with tolerance %f (%lu ulps), but got %f (0x%lx)\n",<br>
                       e.f, e.u, t.f, t.u, v.f, v.u);<br>
                return false;<br>
@@ -162,7 +162,7 @@ piglit_cl_get_platform_version(cl_platform_id platform)<br>
        int scanf_count;<br>
        int major;<br>
        int minor;<br>
-<br>
+<br>
        /*<br>
         * Returned format:<br>
         *   OpenCL<space><major_version.minor_version><space><platform-specific information><br>
@@ -353,7 +353,7 @@ piglit_cl_get_info(void* fn_ptr, void* obj, cl_uint param)<br>
<br>
        if(errNo == CL_SUCCESS) {<br>
                param_ptr = calloc(param_size, sizeof(char));<br>
-<br>
+<br>
                /* retrieve param */<br>
                if(fn_ptr == clGetPlatformInfo) {<br>
                        errNo = clGetPlatformInfo(*(cl_platform_id*)obj, param,<br>
@@ -463,7 +463,7 @@ piglit_cl_get_program_build_info(cl_program program, cl_device_id device,<br>
                .program = program,<br>
                .device = device<br>
        };<br>
-<br>
+<br>
        return piglit_cl_get_info(clGetProgramBuildInfo, &args, param);<br>
 }<br>
<br>
@@ -479,7 +479,7 @@ piglit_cl_get_kernel_work_group_info(cl_kernel kernel, cl_device_id device,<br>
                .kernel = kernel,<br>
                .device = device<br>
        };<br>
-<br>
+<br>
        return piglit_cl_get_info(clGetKernelWorkGroupInfo, &args, param);<br>
 }<br>
<br>
@@ -620,7 +620,7 @@ piglit_cl_get_device_ids(cl_platform_id platform_id, cl_device_type device_type,<br>
                                        piglit_cl_get_error_name(errNo));<br>
                                return 0;<br>
                        }<br>
-<br>
+<br>
                        /* get device list */<br>
                        if(device_ids != NULL && num_device_ids > 0) {<br>
                                *device_ids = malloc(num_device_ids * sizeof(cl_device_id));<br>
@@ -761,7 +761,7 @@ piglit_cl_build_program_with_source_extended(piglit_cl_context context,<br>
                        piglit_cl_get_error_name(errNo));<br>
                return NULL;<br>
        }<br>
-<br>
+<br>
        errNo = clBuildProgram(program,<br>
                               context->num_devices,<br>
                               context->device_ids,<br>
@@ -788,7 +788,7 @@ piglit_cl_build_program_with_source_extended(piglit_cl_context context,<br>
                        char* log = piglit_cl_get_program_build_info(program,<br>
                                                                     context->device_ids[i],<br>
                                                                     CL_PROGRAM_BUILD_LOG);<br>
-<br>
+<br>
                        printf("Build log for device %s:\n -------- \n%s\n -------- \n",<br>
                               device_name,<br>
                               log);<br>
@@ -848,11 +848,11 @@ piglit_cl_build_program_with_binary_extended(piglit_cl_context context,<br>
                for(i = 0; i < context->num_devices; i++) {<br>
                        char* device_name = piglit_cl_get_device_info(context->device_ids[i],<br>
                                                                      CL_DEVICE_NAME);<br>
-<br>
+<br>
                        printf("Error for %s: %s\n",<br>
                               device_name,<br>
                               piglit_cl_get_error_name(binary_status[i]));<br>
-<br>
+<br>
                        free(device_name);<br>
                }<br>
<br>
@@ -860,7 +860,7 @@ piglit_cl_build_program_with_binary_extended(piglit_cl_context context,<br>
                return NULL;<br>
        }<br>
        free(binary_status);<br>
-<br>
+<br>
        errNo = clBuildProgram(program,<br>
                               context->num_devices,<br>
                               context->device_ids,<br>
@@ -884,11 +884,11 @@ piglit_cl_build_program_with_binary_extended(piglit_cl_context context,<br>
                        char* log = piglit_cl_get_program_build_info(program,<br>
                                                                     context->device_ids[i],<br>
                                                                     CL_PROGRAM_BUILD_LOG);<br>
-<br>
+<br>
                        printf("Build log for device %s:\n -------- \n%s\n -------- \n",<br>
                               device_name,<br>
                               log);<br>
-<br>
+<br>
                        free(device_name);<br>
                        free(log);<br>
                }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br></div>