[Beignet] [PATCH 5/5] Backend: add double support to bitselect
rander
rander.wang at intel.com
Tue Mar 7 01:55:30 UTC 2017
Signed-off-by: rander <rander.wang at intel.com>
---
backend/src/libocl/tmpl/ocl_relational.tmpl.cl | 3 +++
backend/src/libocl/tmpl/ocl_relational.tmpl.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/backend/src/libocl/tmpl/ocl_relational.tmpl.cl b/backend/src/libocl/tmpl/ocl_relational.tmpl.cl
index eb3ec7c..3cf78b4 100644
--- a/backend/src/libocl/tmpl/ocl_relational.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_relational.tmpl.cl
@@ -268,6 +268,9 @@ DEF(long); DEF(ulong)
OVERLOADABLE float bitselect(float a, float b, float c) {
return as_float(bitselect(as_int(a), as_int(b), as_int(c)));
}
+OVERLOADABLE double bitselect(double a, double b, double c) {
+ return as_double(bitselect(as_long(a), as_long(b), as_long(c)));
+}
// select
diff --git a/backend/src/libocl/tmpl/ocl_relational.tmpl.h b/backend/src/libocl/tmpl/ocl_relational.tmpl.h
index a4d67aa..0540a91 100644
--- a/backend/src/libocl/tmpl/ocl_relational.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_relational.tmpl.h
@@ -128,6 +128,7 @@ DEF(long) DEF(ulong)
#undef DEF
OVERLOADABLE float bitselect(float a, float b, float c);
OVERLOADABLE half bitselect(half a, half b, half c);
+OVERLOADABLE double bitselect(double a, double b, double c);
#define DEF(TYPE1, TYPE2) \
--
2.7.4
More information about the Beignet
mailing list