From ab2eb420e2bfdfd1f5972a4341b5fb4ccf41c24a Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Wed, 26 Apr 2017 19:01:10 -0500 Subject: [PATCH] fixed fast math expf and exp10f Change-Id: I73963220f902efebb0a7404c5f8966dffb4c35ca --- src/device_util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/device_util.cpp b/src/device_util.cpp index 8ce53765b5..b730412874 100644 --- a/src/device_util.cpp +++ b/src/device_util.cpp @@ -1163,18 +1163,18 @@ __device__ double __hip_precise_dsqrt_rz(double x) { return hc::precise_math::sqrt(x); } -#define LOG_BASE2_E_DIV_2 0.4426950408894701 -#define LOG_BASE2_5 2.321928094887362 +#define LOG_BASE2_E 1.4426950408889634 +#define LOG_BASE2_10 3.32192809488736 #define ONE_DIV_LOG_BASE2_E 0.69314718056 #define ONE_DIV_LOG_BASE2_10 0.30102999566 // Fast Math Intrinsics __device__ float __hip_fast_exp10f(float x) { - return __hip_fast_exp2f(x*LOG_BASE2_E_DIV_2); + return __hip_fast_exp2f(x*LOG_BASE2_E); } __device__ float __hip_fast_expf(float x) { - return __hip_fast_expf(x*LOG_BASE2_5); + return __hip_fast_exp2f(x*LOG_BASE2_10); } __device__ float __hip_fast_frsqrt_rn(float x) {