[Beignet] [PATCH] backend: add double version of acospi

rander rander.wang at intel.com
Thu Mar 30 05:58:01 UTC 2017


	it is a simple implementation, and need refine to pass conformance test

Signed-off-by: rander <rander.wang at intel.com>
---
 backend/src/libocl/tmpl/ocl_math_common.tmpl.cl | 5 +++++
 backend/src/libocl/tmpl/ocl_math_common.tmpl.h  | 1 +
 2 files changed, 6 insertions(+)

diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
index c9c7637..3a3e708 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
@@ -115,6 +115,11 @@ OVERLOADABLE double acos(double x)
     }
 }
 
+OVERLOADABLE double acospi(double x)
+{
+	return acos(x)/M_PI;
+}
+
 OVERLOADABLE double ceil(double x)
 {
     double ret;
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
index 2ffaec1..6d2f678 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
@@ -21,6 +21,7 @@
 #include "ocl_types.h"
 
 OVERLOADABLE double acos(double x);
+OVERLOADABLE double acospi(double x);
 OVERLOADABLE double ceil(double x);
 OVERLOADABLE double copysign(double x, double y);
 OVERLOADABLE double fabs(double x);
-- 
2.7.4



More information about the Beignet mailing list