Commit 06e287e8 authored by letaoqin's avatar letaoqin
Browse files

fix precision

parent 1e447622
...@@ -47,14 +47,14 @@ struct Add ...@@ -47,14 +47,14 @@ struct Add
__host__ __device__ constexpr void __host__ __device__ constexpr void
operator()<half_t>(half_t& y, const float& x0, const half_t& x1) const operator()<half_t>(half_t& y, const float& x0, const half_t& x1) const
{ {
y = type_convert<half_t>(x0) + x1; y = type_convert<half_t>(type_convert<float>(x1) + x0);
}; };
template <> template <>
__host__ __device__ constexpr void __host__ __device__ constexpr void
operator()<half_t>(half_t& y, const half_t& x0, const half_t& x1) const operator()<half_t>(half_t& y, const half_t& x0, const half_t& x1) const
{ {
y = x0 + x1; y = type_convert<float>(x0) + type_convert<float>(x1);
}; };
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