Explicit cast values to half (#1593)

Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>
This commit is contained in:
Jatin Chaudhary
2024-10-22 19:17:32 +01:00
committed by GitHub
parent 82fc53835a
commit 4d5248e2d1

View File

@@ -653,7 +653,7 @@ inline __device__ double sin<double>(double x)
template <>
inline __device__ half_t sin<half_t>(half_t x)
{
return ::hsin(x);
return hsin(static_cast<__half>(x));
};
template <typename T>
@@ -785,7 +785,7 @@ inline __device__ double ceil<double>(double x)
template <>
inline __device__ half_t ceil<half_t>(half_t x)
{
return ::hceil(x);
return hceil(static_cast<__half>(x));
};
template <typename T>
@@ -827,7 +827,7 @@ inline __device__ double floor<double>(double x)
template <>
inline __device__ half_t floor<half_t>(half_t x)
{
return ::hfloor(x);
return hfloor(static_cast<__half>(x));
};
template <typename T>
@@ -849,7 +849,7 @@ inline __device__ T exp(T x)
template <>
inline __device__ half_t exp<half_t>(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>(half_t x)
{
return hlog(x);
return hlog(static_cast<__half>(x));
};
template <>