From 2a074cd3911f5628131bd604cd94aae79767a129 Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary <51944368+cjatin@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:17:32 +0100 Subject: [PATCH] Explicit cast values to half (#1593) Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com> [ROCm/composable_kernel commit: 4d5248e2d17770234f433f1a83aa0294ff60c7b1] --- include/ck/utility/math_v2.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/ck/utility/math_v2.hpp b/include/ck/utility/math_v2.hpp index cbbe155859..b374c4ad55 100644 --- a/include/ck/utility/math_v2.hpp +++ b/include/ck/utility/math_v2.hpp @@ -653,7 +653,7 @@ inline __device__ double sin(double x) template <> inline __device__ half_t sin(half_t x) { - return ::hsin(x); + return hsin(static_cast<__half>(x)); }; template @@ -785,7 +785,7 @@ inline __device__ double ceil(double x) template <> inline __device__ half_t ceil(half_t x) { - return ::hceil(x); + return hceil(static_cast<__half>(x)); }; template @@ -827,7 +827,7 @@ inline __device__ double floor(double x) template <> inline __device__ half_t floor(half_t x) { - return ::hfloor(x); + return hfloor(static_cast<__half>(x)); }; template @@ -849,7 +849,7 @@ inline __device__ T exp(T x) template <> inline __device__ half_t exp(half_t x) { - return hexp(x); + return hexp(static_cast<__half>(x)); }; template <> @@ -873,7 +873,7 @@ inline __device__ T log(T x) template <> inline __device__ half_t log(half_t x) { - return hlog(x); + return hlog(static_cast<__half>(x)); }; template <>