[Beignet] [PATCH] Backend: add double support to convert_uchar|short_rtn(double x)
rander
rander.wang at intel.com
Thu Mar 9 01:23:30 UTC 2017
Signed-off-by: rander <rander.wang at intel.com>
---
backend/src/libocl/script/ocl_convert.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/backend/src/libocl/script/ocl_convert.sh b/backend/src/libocl/script/ocl_convert.sh
index b826b38..fe5c1ec 100755
--- a/backend/src/libocl/script/ocl_convert.sh
+++ b/backend/src/libocl/script/ocl_convert.sh
@@ -550,6 +550,26 @@ OVERLOADABLE float __convert_float_rtn(uint x)
return __convert_float_rtz(x);
}
+OVERLOADABLE char convert_char_rtn(double x)
+{
+ return (char)convert_int_rtn(x);
+}
+
+OVERLOADABLE uchar convert_uchar_rtn(double x)
+{
+ return (uchar)convert_int_rtn(x);
+}
+
+OVERLOADABLE short convert_short_rtn(double x)
+{
+ return (short)convert_int_rtn(x);
+}
+
+OVERLOADABLE ushort convert_ushort_rtn(double x)
+{
+ return (ushort)convert_int_rtn(x);
+}
+
OVERLOADABLE int convert_int_rtn(double x)
{
int ret, iexp ;
--
2.7.4
More information about the Beignet
mailing list