diff options
author | rander <rander.wang@intel.com> | 2017-03-31 15:13:38 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-04-17 16:08:49 +0800 |
commit | ab61725c72cddf52b3992b56baa74a57393fb56f (patch) | |
tree | 0138dc47dbcd86b95dc15cf673287b1fe33a2ff1 | |
parent | 4d9fffb18d08adcd1e8cc08566d467b69cd6d27b (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.cl | 10 | ||||
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math_common.tmpl.h | 2 |
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); |