Commit 6c39e6af authored by Andriy Roshchenko's avatar Andriy Roshchenko
Browse files

Add tensor generator specialization for scales

parent a24c1b01
...@@ -359,6 +359,21 @@ struct GeneratorTensor_Sequential ...@@ -359,6 +359,21 @@ struct GeneratorTensor_Sequential
} }
}; };
template <ck::index_t Dim>
struct GeneratorTensor_Sequential<ck::e8m0_bexp_t, Dim>
{
int offset = 0;
template <typename... Ts>
ck::e8m0_bexp_t operator()(Ts... Xs) const
{
std::array<ck::index_t, sizeof...(Ts)> dims = {{static_cast<ck::index_t>(Xs)...}};
int tmp = dims[Dim];
return ck::type_convert<ck::e8m0_bexp_t>(powf(2, tmp + offset));
}
};
template <typename T, size_t NumEffectiveDim = 2> template <typename T, size_t NumEffectiveDim = 2>
struct GeneratorTensor_Diagonal struct GeneratorTensor_Diagonal
{ {
......
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