We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In function coalesce_x, shape value is using default Int<2>{} when last shape value equal to constant one. Why need to do this?
` template <class Shape, class Stride> CUTE_HOST_DEVICE constexpr auto coalesce_x(Layout<Shape,Stride> const& layout) { auto flat_shape = flatten(layout.shape()); auto flat_stride = flatten(layout.stride());
constexpr int R = decltype(rank(flat_shape))::value; if constexpr (is_constant<1, decltype(get(flat_shape))>::value) { return detail::bw_coalesce(flat_shape, flat_stride, Int<2>{}, get(flat_stride)); } else { return detail::bw_coalesce(flat_shape, flat_stride, get(flat_shape), get(flat_stride)); } } `
The text was updated successfully, but these errors were encountered:
It is an implementation detail that fixes cases like
(4,1):(1,42) o 12:1 => (4,3):(1,42)
to obey the composition definition
(A o B)(c) = A(B(c))
even when B(c) is "out-of-bounds" of A while also wanting to coalesce A before computing the result.
B(c)
A
Sorry, something went wrong.
No branches or pull requests
In function coalesce_x, shape value is using default Int<2>{} when last shape value equal to constant one. Why need to do this?
`
template <class Shape, class Stride>
CUTE_HOST_DEVICE constexpr
auto
coalesce_x(Layout<Shape,Stride> const& layout)
{
auto flat_shape = flatten(layout.shape());
auto flat_stride = flatten(layout.stride());
constexpr int R = decltype(rank(flat_shape))::value;
if constexpr (is_constant<1, decltype(get(flat_shape))>::value) {
return detail::bw_coalesce(flat_shape, flat_stride, Int<2>{}, get(flat_stride));
} else {
return detail::bw_coalesce(flat_shape, flat_stride, get(flat_shape), get(flat_stride));
}
}
`
The text was updated successfully, but these errors were encountered: