[Beignet] [PATCH] libocl: add vload/vstore for half type

Jan Vesely jano.vesely at gmail.com
Sat Jul 30 23:34:13 UTC 2016


these are required when exposing cl_khr_fp16

Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
---
 backend/src/libocl/include/ocl_vload.h | 1 +
 backend/src/libocl/src/ocl_vload.cl    | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/backend/src/libocl/include/ocl_vload.h b/backend/src/libocl/include/ocl_vload.h
index 1e6871e..c26f640 100644
--- a/backend/src/libocl/include/ocl_vload.h
+++ b/backend/src/libocl/include/ocl_vload.h
@@ -88,6 +88,7 @@ DECL_BYTE_RW_ALL(char)
 DECL_BYTE_RW_ALL(uchar)
 DECL_BYTE_RW_ALL(short)
 DECL_BYTE_RW_ALL(ushort)
+DECL_BYTE_RW_ALL(half)
 DECL_UNTYPED_RW_ALL(int)
 DECL_UNTYPED_RW_ALL(uint)
 DECL_UNTYPED_RW_ALL(long)
diff --git a/backend/src/libocl/src/ocl_vload.cl b/backend/src/libocl/src/ocl_vload.cl
index 38a87c4..dc9ad25 100644
--- a/backend/src/libocl/src/ocl_vload.cl
+++ b/backend/src/libocl/src/ocl_vload.cl
@@ -16,6 +16,7 @@
  *
  */
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
 #include "ocl_vload.h"
 #include "ocl_relational.h"
 
@@ -123,6 +124,7 @@ DECL_BYTE_RW_ALL(char)
 DECL_BYTE_RW_ALL(uchar)
 DECL_BYTE_RW_ALL(short)
 DECL_BYTE_RW_ALL(ushort)
+DECL_BYTE_RW_ALL(half)
 DECL_UNTYPED_RW_ALL(int)
 DECL_UNTYPED_RW_ALL(uint)
 DECL_UNTYPED_RW_ALL(long)
-- 
2.7.4



More information about the Beignet mailing list