From fc2c8de816c469df01cc44ff70e09b30e967fd2d Mon Sep 17 00:00:00 2001 From: lcskrishna Date: Thu, 6 Sep 2018 15:02:52 -0700 Subject: [PATCH] added host for float2half and hlaf2float --- hipamd/include/hip/hcc_detail/hip_fp16.h | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/hipamd/include/hip/hcc_detail/hip_fp16.h b/hipamd/include/hip/hcc_detail/hip_fp16.h index 777113a9de..68f0e35f5f 100644 --- a/hipamd/include/hip/hcc_detail/hip_fp16.h +++ b/hipamd/include/hip/hcc_detail/hip_fp16.h @@ -635,37 +635,37 @@ THE SOFTWARE. // TODO: rounding behaviour is not correct. // float -> half | half2 inline - __device__ + __device__ __host__ __half __float2half(float x) { return __half_raw{static_cast<_Float16>(x)}; } inline - __device__ + __device__ __host__ __half __float2half_rn(float x) { return __half_raw{static_cast<_Float16>(x)}; } inline - __device__ + __device__ __host__ __half __float2half_rz(float x) { return __half_raw{static_cast<_Float16>(x)}; } inline - __device__ + __device__ __host__ __half __float2half_rd(float x) { return __half_raw{static_cast<_Float16>(x)}; } inline - __device__ + __device__ __host__ __half __float2half_ru(float x) { return __half_raw{static_cast<_Float16>(x)}; } inline - __device__ + __device__ __host__ __half2 __float2half2_rn(float x) { return __half2_raw{ @@ -673,14 +673,14 @@ THE SOFTWARE. static_cast<_Float16>(x), static_cast<_Float16>(x)}}; } inline - __device__ + __device__ __host__ __half2 __floats2half2_rn(float x, float y) { return __half2_raw{_Float16_2{ static_cast<_Float16>(x), static_cast<_Float16>(y)}}; } inline - __device__ + __device__ __host__ __half2 __float22half2_rn(float2 x) { return __floats2half2_rn(x.x, x.y); @@ -688,25 +688,25 @@ THE SOFTWARE. // half | half2 -> float inline - __device__ + __device__ __host__ float __half2float(__half x) { return static_cast<__half_raw>(x).data; } inline - __device__ + __device__ __host__ float __low2float(__half2 x) { return static_cast<__half2_raw>(x).data.x; } inline - __device__ + __device__ __host__ float __high2float(__half2 x) { return static_cast<__half2_raw>(x).data.y; } inline - __device__ + __device__ __host__ float2 __half22float2(__half2 x) { return make_float2( @@ -1633,4 +1633,4 @@ THE SOFTWARE. #endif // defined(__cplusplus) #elif defined(__GNUC__) #include "hip_fp16_gcc.h" -#endif // !defined(__clang__) && defined(__GNUC__) \ No newline at end of file +#endif // !defined(__clang__) && defined(__GNUC__)