[05/14] Libocl: Add sub group broadcast short builtin function

Submitted by Pan Xiuli on Oct. 12, 2016, 8:56 a.m.


Message ID 1476262604-27504-5-git-send-email-xiuli.pan@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Pan Xiuli Oct. 12, 2016, 8:56 a.m.
From: Pan Xiuli <xiuli.pan@intel.com>

Add sub group broadcast and intel sub group broadcast for short type.

Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
 backend/src/libocl/tmpl/ocl_simd.tmpl.cl | 9 +++++++++
 backend/src/libocl/tmpl/ocl_simd.tmpl.h  | 4 ++++
 2 files changed, 13 insertions(+)

Patch hide | download patch | download mbox

diff --git a/backend/src/libocl/tmpl/ocl_simd.tmpl.cl b/backend/src/libocl/tmpl/ocl_simd.tmpl.cl
index 245ce8a..d1bcfa3 100644
--- a/backend/src/libocl/tmpl/ocl_simd.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_simd.tmpl.cl
@@ -50,8 +50,17 @@  BROADCAST_IMPL(ulong)
+OVERLOADABLE short intel_sub_group_broadcast(short a, uint local_id) {
+  return __gen_ocl_sub_group_broadcast(a, local_id);
+OVERLOADABLE ushort intel_sub_group_broadcast(ushort a, uint local_id) {
+  return __gen_ocl_sub_group_broadcast(a, local_id);
     OVERLOADABLE GEN_TYPE __gen_ocl_sub_group_##RANGE##_##OP(bool sign, GEN_TYPE x); \
diff --git a/backend/src/libocl/tmpl/ocl_simd.tmpl.h b/backend/src/libocl/tmpl/ocl_simd.tmpl.h
index e8dc6f4..c609c2e 100644
--- a/backend/src/libocl/tmpl/ocl_simd.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_simd.tmpl.h
@@ -42,7 +42,11 @@  OVERLOADABLE ulong sub_group_broadcast(ulong a, uint local_id);
 OVERLOADABLE half sub_group_broadcast(half a, uint local_id);
 OVERLOADABLE float sub_group_broadcast(float a, uint local_id);
 OVERLOADABLE double sub_group_broadcast(double a, uint local_id);
+OVERLOADABLE short sub_group_broadcast(short a,uint local_id);
+OVERLOADABLE ushort sub_group_broadcast(ushort a, uint local_id);
+OVERLOADABLE short intel_sub_group_broadcast(short a, uint local_id);
+OVERLOADABLE ushort intel_sub_group_broadcast(ushort a, uint local_id);
 /* reduce add */
 OVERLOADABLE int sub_group_reduce_add(int x);
 OVERLOADABLE uint sub_group_reduce_add(uint x);