Fix float2int rounding functions

Change-Id: I67943859a6344c5eec0eaa23418c9b802ef72468


[ROCm/hip commit: 4c96882366]
This commit is contained in:
Maneesh Gupta
2017-11-23 09:57:24 +05:30
parent 6e332812fc
commit 2e043b7c0e
+9 -4
View File
@@ -23,6 +23,11 @@ THE SOFTWARE.
#include <hc_math.hpp>
#include "device_util.h"
extern "C" float __ocml_floor_f32(float);
extern "C" float __ocml_rint_f32(float);
extern "C" float __ocml_ceil_f32(float);
extern "C" float __ocml_trunc_f32(float);
struct holder64Bit{
union{
double d;
@@ -151,19 +156,19 @@ __device__ long long int __double_as_longlong(double x)
__device__ int __float2int_rd(float x)
{
return (int)x;
return (int)__ocml_floor_f32(x);
}
__device__ int __float2int_rn(float x)
{
return (int)x;
return (int)__ocml_rint_f32(x);
}
__device__ int __float2int_ru(float x)
{
return (int)x;
return (int)__ocml_ceil_f32(x);
}
__device__ int __float2int_rz(float x)
{
return (int)x;
return (int)__ocml_trunc_f32(x);
}
__device__ long long int __float2ll_rd(float x)