[Beignet] [PATCH] Backend: add double support to convert_u|char|u|short|u|int_rte(double x)

rander rander.wang at intel.com
Fri Mar 10 01:43:23 UTC 2017


Signed-off-by: rander <rander.wang at intel.com>
---
 backend/src/libocl/script/ocl_convert.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backend/src/libocl/script/ocl_convert.sh b/backend/src/libocl/script/ocl_convert.sh
index ef65ff5..53fb82c 100755
--- a/backend/src/libocl/script/ocl_convert.sh
+++ b/backend/src/libocl/script/ocl_convert.sh
@@ -713,6 +713,15 @@ OVERLOADABLE ulong convert_ulong_rte(double x)
 '
 fi
 
+ITYPES="int:4 uint:4 short:2 ushort:2 char:1 uchar:1"
+for ttype in $ITYPES; do
+	tbasetype=`IFS=:; set -- dummy $ttype; echo $2`
+	if [ $1"a" != "-pa" ]; then
+	echo "OVERLOADABLE $tbasetype convert_${tbasetype}_rte(double x)"
+	echo "{ return ($tbasetype)convert_long_rte(x);}"
+	fi
+done
+
 # convert_DSTTYPE_ROUNDING function
 for vector_length in $VECTOR_LENGTHS; do
     for ftype in $TYPES; do
-- 
2.7.4



More information about the Beignet mailing list