[Beignet] [PATCH opencl-1.2] Fix the random failed of compiler_fill_image_1d

Zhigang Gong zhigang.gong at linux.intel.com
Tue Jun 10 22:18:28 PDT 2014


LGTM, will push latter.

On Wed, Jun 11, 2014 at 11:59:56AM +0800, junyan.he at inbox.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
> 
> This case failed because we do not init the dst
> buffer to all zero. It have some random value in it.
> 
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
>  utests/compiler_fill_image_1d.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/utests/compiler_fill_image_1d.cpp b/utests/compiler_fill_image_1d.cpp
> index c1011ba..e644c5f 100644
> --- a/utests/compiler_fill_image_1d.cpp
> +++ b/utests/compiler_fill_image_1d.cpp
> @@ -21,6 +21,12 @@ static void compiler_fill_image_1d(void)
>  
>    OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);
>  
> +  OCL_MAP_BUFFER_GTT(0);
> +  for (uint32_t i = 0; i < w; i++) {
> +      ((uint32_t*)buf_data[0])[i] = 0;
> +  }
> +  OCL_UNMAP_BUFFER_GTT(0);
> +
>    // Run the kernel
>    OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
>    globals[0] = w/2;
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list