Commit a82ae8e5 authored by Jatin Chaudhary's avatar Jatin Chaudhary Committed by Pruthvi Madugundu
Browse files

Explicit cast values to half (#1593)


Co-authored-by: default avatarIllia Silin <98187287+illsilin@users.noreply.github.com>
parent 2a3f32b1
...@@ -649,7 +649,7 @@ inline __device__ double sin<double>(double x) ...@@ -649,7 +649,7 @@ inline __device__ double sin<double>(double x)
template <> template <>
inline __device__ half_t sin<half_t>(half_t x) inline __device__ half_t sin<half_t>(half_t x)
{ {
return ::hsin(x); return hsin(static_cast<__half>(x));
}; };
template <typename T> template <typename T>
...@@ -781,7 +781,7 @@ inline __device__ double ceil<double>(double x) ...@@ -781,7 +781,7 @@ inline __device__ double ceil<double>(double x)
template <> template <>
inline __device__ half_t ceil<half_t>(half_t x) inline __device__ half_t ceil<half_t>(half_t x)
{ {
return ::hceil(x); return hceil(static_cast<__half>(x));
}; };
template <typename T> template <typename T>
...@@ -823,7 +823,7 @@ inline __device__ double floor<double>(double x) ...@@ -823,7 +823,7 @@ inline __device__ double floor<double>(double x)
template <> template <>
inline __device__ half_t floor<half_t>(half_t x) inline __device__ half_t floor<half_t>(half_t x)
{ {
return ::hfloor(x); return hfloor(static_cast<__half>(x));
}; };
template <typename T> template <typename T>
...@@ -845,7 +845,7 @@ inline __device__ T exp(T x) ...@@ -845,7 +845,7 @@ inline __device__ T exp(T x)
template <> template <>
inline __device__ half_t exp<half_t>(half_t x) inline __device__ half_t exp<half_t>(half_t x)
{ {
return hexp(x); return hexp(static_cast<__half>(x));
}; };
template <> template <>
...@@ -869,7 +869,7 @@ inline __device__ T log(T x) ...@@ -869,7 +869,7 @@ inline __device__ T log(T x)
template <> template <>
inline __device__ half_t log<half_t>(half_t x) inline __device__ half_t log<half_t>(half_t x)
{ {
return hlog(x); return hlog(static_cast<__half>(x));
}; };
template <> template <>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment