[Beignet] [PATCH 2/6] Utest: Fix sub group broadcast for simd8

Yang, Rong R rong.r.yang at intel.com
Mon Sep 5 05:35:09 UTC 2016


What's the behavior spec defined when index out of range? Need add a check to sub_group functions?

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Xiuli Pan
> Sent: Friday, September 2, 2016 16:51
> To: beignet at lists.freedesktop.org
> Cc: Pan, Xiuli <xiuli.pan at intel.com>
> Subject: [Beignet] [PATCH 2/6] Utest: Fix sub group broadcast for simd8
> 
> From: Pan Xiuli <xiuli.pan at intel.com>
> 
> In simd8 mode, the sub group size is 8. We should use some index less than 8.
> 
> Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
> ---
>  kernels/compiler_subgroup_broadcast.cl | 2 +-
> utests/compiler_subgroup_broadcast.cpp | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernels/compiler_subgroup_broadcast.cl
> b/kernels/compiler_subgroup_broadcast.cl
> index 8c155ee..457c826 100644
> --- a/kernels/compiler_subgroup_broadcast.cl
> +++ b/kernels/compiler_subgroup_broadcast.cl
> @@ -42,7 +42,7 @@ kernel void compiler_subgroup_broadcast_half(global
> half *src,
> 
>    half val = src[index];
>    half broadcast_val = sub_group_broadcast(val, simd_id);
> -  printf("%d val %d is %d\n",index,as_ushort(val), as_ushort(broadcast_val));
> +  //printf("%d val %d is %d\n",index,as_ushort(val),
> + as_ushort(broadcast_val));
>    dst[index] = broadcast_val;
>  }
>  #endif
> diff --git a/utests/compiler_subgroup_broadcast.cpp
> b/utests/compiler_subgroup_broadcast.cpp
> index 9a7979c..5aa749c 100644
> --- a/utests/compiler_subgroup_broadcast.cpp
> +++ b/utests/compiler_subgroup_broadcast.cpp
> @@ -108,7 +108,7 @@ static void subgroup_generic(T* input,
>    size_t SIMD_SIZE = 0;
> 
> OCL_CALL(utestclGetKernelSubGroupInfoKHR,kernel,device,CL_KERNEL_M
> AX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR,sizeof(size_t)*1,locals,sizeof(si
> ze_t),&SIMD_SIZE,NULL);
> 
> -  cl_uint SIMD_ID = 10;
> +  cl_uint SIMD_ID = 2;
>    /* input and expected data */
>    generate_data(input, expected, SIMD_ID, SIMD_SIZE);
> 
> --
> 2.7.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list