MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / unflatten_impl

Function unflatten_impl

include/cute/algorithm/tuple_algorithms.hpp:584–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582
583template <class FlatTuple, class TargetProfile>
584CUTE_HOST_DEVICE constexpr
585auto
586unflatten_impl(FlatTuple const& flat_tuple, TargetProfile const& target_profile)
587{
588 if constexpr (is_tuple<TargetProfile>::value) {
589 return fold(target_profile, cute::make_tuple(cute::make_tuple(), flat_tuple), [](auto const& v, auto const& t) {
590 auto [result, remaining_tuple] = v;
591 auto [sub_result, sub_tuple] = unflatten_impl(remaining_tuple, t);
592 return cute::make_tuple(append(result, sub_result), sub_tuple);
593 });
594 } else {
595 return cute::make_tuple(get<0>(flat_tuple), take<1, decltype(rank(flat_tuple))::value>(flat_tuple));
596 }
597
598 CUTE_GCC_UNREACHABLE;
599}
600
601} // end namespace detail
602

Callers 1

unflattenFunction · 0.85

Calls 3

foldFunction · 0.85
appendFunction · 0.70
rankFunction · 0.50

Tested by

no test coverage detected