Commit 4d90c0df authored by Rostyslav Geyyer's avatar Rostyslav Geyyer
Browse files

Add element-wise ops

parent c3fdcafb
...@@ -144,6 +144,38 @@ struct PassThrough ...@@ -144,6 +144,38 @@ struct PassThrough
y = type_convert<f8_t>(x); y = type_convert<f8_t>(x);
} }
#endif #endif
#if defined CK_ENABLE_BF8
template <>
__host__ __device__ void operator()<bf8_t, bf8_t>(bf8_t& y, const bf8_t& x) const
{
y = x;
}
template <>
__host__ __device__ void operator()<float, bf8_t>(float& y, const bf8_t& x) const
{
y = type_convert<float>(x);
}
template <>
__host__ __device__ void operator()<bf8_t, float>(bf8_t& y, const float& x) const
{
y = type_convert<bf8_t>(x);
}
template <>
__host__ __device__ void operator()<half_t, bf8_t>(half_t& y, const bf8_t& x) const
{
y = type_convert<half_t>(x);
}
template <>
__host__ __device__ void operator()<bf8_t, half_t>(bf8_t& y, const half_t& x) const
{
y = type_convert<bf8_t>(x);
}
#endif
}; };
struct UnaryConvert struct UnaryConvert
......
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