The spec only defined the index should be a sub group local id. In simd 8 mode, it should be less than 8. The fix here is change the index to make the test fit for both simd 16 and simd 8.
-----Original Message----- From: Yang, Rong R Sent: Monday, September 5, 2016 1:35 PM To: Pan, Xiuli <[email protected]>; [email protected] Cc: Pan, Xiuli <[email protected]> Subject: RE: [Beignet] [PATCH 2/6] Utest: Fix sub group broadcast for simd8 What's the behavior spec defined when index out of range? Need add a check to sub_group functions? > -----Original Message----- > From: Beignet [mailto:[email protected]] On Behalf > Of Xiuli Pan > Sent: Friday, September 2, 2016 16:51 > To: [email protected] > Cc: Pan, Xiuli <[email protected]> > Subject: [Beignet] [PATCH 2/6] Utest: Fix sub group broadcast for > simd8 > > From: Pan Xiuli <[email protected]> > > In simd8 mode, the sub group size is 8. We should use some index less than 8. > > Signed-off-by: Pan Xiuli <[email protected]> > --- > 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 > [email protected] > https://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/beignet
