From 1dce01f9bb085e6288852af5657ededd8d384dcc Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Thu, 25 May 2017 23:15:30 -0400 Subject: [PATCH] fix hip_fast_dsqrt* to call a double fp sqrt function --- src/device_util.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/device_util.cpp b/src/device_util.cpp index b730412874..bea42aba46 100644 --- a/src/device_util.cpp +++ b/src/device_util.cpp @@ -1215,20 +1215,23 @@ __device__ float __hip_fast_tanf(float x) { } // Double Precision Math +// FIXME - HCC doesn't have a fast_math version double FP sqrt +// Another issue is that these intrinsics call for a specific rounding mode; +// however, their implementation all map to the same sqrt builtin __device__ double __hip_fast_dsqrt_rd(double x) { - return hc::fast_math::sqrt(x); + return hc::precise_math::sqrt(x); } __device__ double __hip_fast_dsqrt_rn(double x) { - return hc::fast_math::sqrt(x); + return hc::precise_math::sqrt(x); } __device__ double __hip_fast_dsqrt_ru(double x) { - return hc::fast_math::sqrt(x); + return hc::precise_math::sqrt(x); } __device__ double __hip_fast_dsqrt_rz(double x) { - return hc::fast_math::sqrt(x); + return hc::precise_math::sqrt(x); } __device__ void __threadfence_system(void){