From ab61725c72cddf52b3992b56baa74a57393fb56f Mon Sep 17 00:00:00 2001 From: rander Date: Fri, 31 Mar 2017 15:13:38 +0800 Subject: backend: add double version of exp2 exp10 convert them to pow. need to be refined for performance Signed-off-by: rander Tested-by: Yang Rong --- backend/src/libocl/tmpl/ocl_math_common.tmpl.cl | 10 ++++++++++ backend/src/libocl/tmpl/ocl_math_common.tmpl.h | 2 ++ 2 files changed, 12 insertions(+) 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); -- cgit v1.2.3