[Beignet] [PATCH] utest: memset the output buffer to fix random fail.
Zhigang Gong
zhigang.gong at linux.intel.com
Tue Sep 3 01:03:24 PDT 2013
LGTM, thanks.
On Tue, Sep 03, 2013 at 03:39:56PM +0800, Ruiling Song wrote:
> the inactive lanes will not modify corresponding output.
> So, output buffer needs initialization to 0.
>
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
> utests/compiler_group_size.cpp | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/utests/compiler_group_size.cpp b/utests/compiler_group_size.cpp
> index 724d6e8..0c8881c 100644
> --- a/utests/compiler_group_size.cpp
> +++ b/utests/compiler_group_size.cpp
> @@ -107,6 +107,10 @@ void compiler_group_size4(void)
> ((struct xyz*)buf_data[0])[0].o = 0;
> OCL_UNMAP_BUFFER(0);
>
> + OCL_MAP_BUFFER(1);
> + memset(((uint32_t*)buf_data[1]), 0x0, sizeof(uint32_t)*n);
> + OCL_UNMAP_BUFFER(1);
> +
> OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
> OCL_SET_ARG(1, sizeof(cl_mem), &buf[1]);
> OCL_SET_ARG(2, sizeof(cl_int), &group_size[i]);
> @@ -127,7 +131,6 @@ void compiler_group_size4(void)
> }
>
> }
> - memset(((uint32_t*)buf_data[1]), 0x0, sizeof(int)*n);
> OCL_UNMAP_BUFFER(1);
> }
> }
> --
> 1.7.9.5
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list