[Beignet] [PATCH] backend: add double version of tanpi
rander
rander.wang at intel.com
Thu Mar 30 07:25:43 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 9f36e70..cf12281 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
@@ -2087,6 +2087,11 @@ OVERLOADABLE double tanh(double x)
return (jx>=0)? z: -z;
}
+OVERLOADABLE double tanpi(double x)
+{
+ return tan(x*M_PI);
+}
+
OVERLOADABLE double trunc(double x)
{
double ret = floor(fabs(x));
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
index 4401308..a591046 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
@@ -61,6 +61,7 @@ OVERLOADABLE double sinpi(double x);
OVERLOADABLE double sqrt(double x);
OVERLOADABLE double tan(double x);
OVERLOADABLE double tanh(double x);
+OVERLOADABLE double tanpi(double x);
OVERLOADABLE double trunc(double x);
--
2.7.4
More information about the Beignet
mailing list