summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrander <rander.wang@intel.com>2017-03-31 15:13:38 +0800
committerYang Rong <rong.r.yang@intel.com>2017-04-17 16:08:49 +0800
commitab61725c72cddf52b3992b56baa74a57393fb56f (patch)
tree0138dc47dbcd86b95dc15cf673287b1fe33a2ff1
parent4d9fffb18d08adcd1e8cc08566d467b69cd6d27b (diff)
backend: add double version of exp2 exp10
convert them to pow. need to be refined for performance Signed-off-by: rander <rander.wang@intel.com> Tested-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/libocl/tmpl/ocl_math_common.tmpl.cl10
-rw-r--r--backend/src/libocl/tmpl/ocl_math_common.tmpl.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
index 6abf5a76..63aa0de0 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.cl
@@ -604,6 +604,16 @@ OVERLOADABLE double expm1(double x)
return y;
}
+OVERLOADABLE double exp2(double x)
+{
+ return pow(2, x);
+}
+
+OVERLOADABLE double exp10(double x)
+{
+ return pow(10, x);
+}
+
OVERLOADABLE double erf(double x)
{
double erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */
diff --git a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
index 6c479af4..f7a651e4 100644
--- a/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
+++ b/backend/src/libocl/tmpl/ocl_math_common.tmpl.h
@@ -33,6 +33,8 @@ OVERLOADABLE double atan2pi(double x, double y);
OVERLOADABLE double atanh(double x);
OVERLOADABLE double exp(double x);
OVERLOADABLE double expm1(double x);
+OVERLOADABLE double exp2(double x);
+OVERLOADABLE double exp10(double x);
OVERLOADABLE double erf(double x);
OVERLOADABLE double erfc(double x);
OVERLOADABLE double cbrt(double x);