summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2014-06-23 16:34:54 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-23 16:53:31 +0800
commit5f084e7ee190e49a82ff162a4cdfcaee68c37a18 (patch)
tree6d332fc66ec5f6aea68fd921ceaa5106768cf177
parente2b18273008699bbc2113375800baab94d7a1bd5 (diff)
downloadbeignet-5f084e7ee190e49a82ff162a4cdfcaee68c37a18.tar.gz
GBE: fix some builtin math function
__gen_ocl_exp stands for 2^x. So, use __gen_ocl_pow to implement native_exp(). Fix atanh implementation. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rwxr-xr-xbackend/src/ocl_stdlib.tmpl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h
index 1393ae72..ec945e4a 100755
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -2266,8 +2266,8 @@ INLINE_OVERLOADABLE float native_tan(float x) {
INLINE_OVERLOADABLE float __gen_ocl_internal_tanpi(float x) {
return native_tan(x * M_PI_F);
}
-INLINE_OVERLOADABLE float native_exp(float x) { return __gen_ocl_exp(x); }
-INLINE_OVERLOADABLE float native_exp2(float x) { return __gen_ocl_pow(2, x); }
+INLINE_OVERLOADABLE float native_exp2(float x) { return __gen_ocl_exp(x); }
+INLINE_OVERLOADABLE float native_exp(float x) { return __gen_ocl_pow(M_E_F, x); }
INLINE_OVERLOADABLE float native_exp10(float x) { return __gen_ocl_pow(10, x); }
INLINE_OVERLOADABLE float __gen_ocl_internal_cbrt(float x) {
/* copied from fdlibm */
@@ -4986,7 +4986,7 @@ INLINE_OVERLOADABLE float __gen_ocl_internal_fastpath_asinh (float x)
INLINE_OVERLOADABLE float __gen_ocl_internal_fastpath_atanh (float x)
{
- return 0.5f * native_sqrt((1 + x) / (1 - x));
+ return 0.5f * native_log((1 + x) / (1 - x));
}
INLINE_OVERLOADABLE float __gen_ocl_internal_fastpath_cbrt (float x)