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

Xiuli Pan xiuli.pan at intel.com
Fri Sep 2 08:50:48 UTC 2016


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_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR,sizeof(size_t)*1,locals,sizeof(size_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



More information about the Beignet mailing list