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

rander rander.wang at intel.com
Thu Mar 30 07:21:56 UTC 2017


	it is a simple implementation and need to be refined to pass cft

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 c370864..e645238 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
@@ -1089,6 +1089,11 @@ OVERLOADABLE double cosh(double x)
 
 }
 
+OVERLOADABLE double cospi(double x)
+{
+	return cos(x*M_PI);
+}
+
 OVERLOADABLE double fabs(double x)
 {
     long  qw = as_ulong(x);
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
index 471f866..5f703f3 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
@@ -37,6 +37,7 @@ OVERLOADABLE double ceil(double x);
 OVERLOADABLE double copysign(double x, double y);
 OVERLOADABLE double cos(double x);
 OVERLOADABLE double cosh(double x);
+OVERLOADABLE double cospi(double x);
 OVERLOADABLE double fabs(double x);
 OVERLOADABLE double fdim(double x, double y);
 OVERLOADABLE double floor(double x);
-- 
2.7.4



More information about the Beignet mailing list