Commit 4797b291 authored by Rosty Geyyer's avatar Rosty Geyyer
Browse files

Add UnaryConvertPrecision struct for high-precision workloads

parent ab9dec04
...@@ -86,6 +86,18 @@ struct UnaryConvert ...@@ -86,6 +86,18 @@ struct UnaryConvert
} }
}; };
struct UnaryConvertPrecision : UnaryConvert
{
template <typename Y, typename X>
__host__ __device__ void operator()(Y& y, const X& x) const;
template <>
__host__ __device__ void operator()<bhalf_t, float>(bhalf_t& y, const float& x) const
{
y = type_convert_bf16_rtn(x);
}
};
struct Scale struct Scale
{ {
__host__ __device__ Scale(float scale) : scale_(scale) {} __host__ __device__ Scale(float scale) : scale_(scale) {}
......
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