Unverified Commit 38a90b6e authored by Chao Liu's avatar Chao Liu Committed by GitHub
Browse files

Merge pull request #43 from ROCmSoftwarePlatform/develop

Merge develop into master
parents 88833bd9 c3018794
...@@ -1008,20 +1008,27 @@ struct inner_product_with_conversion ...@@ -1008,20 +1008,27 @@ struct inner_product_with_conversion
}; };
template <typename T> template <typename T>
struct NumericLimits; struct NumericLimits
{
__host__ __device__ static constexpr T Min() { return std::numeric_limits<T>::min(); }
__host__ __device__ static constexpr T Max() { return std::numeric_limits<T>::max(); }
__host__ __device__ static constexpr T Lowest() { return std::numeric_limits<T>::lowest(); }
};
template <> template <>
struct NumericLimits<int32_t> struct NumericLimits<half_t>
{ {
__host__ __device__ static constexpr int32_t Min() static constexpr unsigned short binary_min = 0x0400;
{ static constexpr unsigned short binary_max = 0x7BFF;
return std::numeric_limits<int32_t>::min(); static constexpr unsigned short binary_lowest = 0xFBFF;
}
__host__ __device__ static constexpr int32_t Max() __host__ __device__ static constexpr half_t Min() { return as_type<half_t>(binary_min); }
{
return std::numeric_limits<int32_t>::max(); __host__ __device__ static constexpr half_t Max() { return as_type<half_t>(binary_max); }
}
__host__ __device__ static constexpr half_t Lowest() { return as_type<half_t>(binary_lowest); }
}; };
} // namespace ck } // namespace ck
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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