You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current layout composition algorithm depends on left-distributive and stride-divisibility-condition. It seems to have some corners not covered. Consider layout A, B and their composition as follows,
auto A = Layout<Shape<_2, _3>, Stride<_3, _1>>{};
auto B = Layout<Shape<_2, _2>, Stride<_3, _2>>{};
// auto C = composition(A, B); // stride-divisibility-condition violated.auto C = Layout<Shape<_2, _2>, Stride<_4, _1>>{};
static_assert(C(Int<0>{}) == A(B(Int<0>{})));
static_assert(C(Int<1>{}) == A(B(Int<1>{})));
static_assert(C(Int<2>{}) == A(B(Int<2>{})));
static_assert(C(Int<3>{}) == A(B(Int<3>{})));
I got 'static assertion failed with "Stride Divisibility Condition"' when I tried to cute::compose layout A and B. But the not-commented layout C constructed by-hand clearly is a valid composition, which is also supported by these static assertions.
Are cases like this deliberately omitted? Is it mathmatically impossible to handle them, or because the code would cost to much to compile or run?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The current layout composition algorithm depends on left-distributive and stride-divisibility-condition. It seems to have some corners not covered. Consider layout
A
,B
and their composition as follows,I got 'static assertion failed with "Stride Divisibility Condition"' when I tried to
cute::compose
layoutA
andB
. But the not-commented layoutC
constructed by-hand clearly is a valid composition, which is also supported by these static assertions.Are cases like this deliberately omitted? Is it mathmatically impossible to handle them, or because the code would cost to much to compile or run?
Thanks in advance for any answers or clues.
Beta Was this translation helpful? Give feedback.
All reactions