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

Function append

include/cute/algorithm/tuple_algorithms.hpp:779–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777
778template <int N, class T, class X>
779CUTE_HOST_DEVICE constexpr
780auto
781append(T const& a, X const& x)
782{
783 if constexpr (is_tuple<T>::value) {
784 if constexpr (N == tuple_size<T>::value) {
785 return a;
786 } else {
787 static_assert(N > tuple_size<T>::value);
788 return detail::construct(a, x, make_seq<tuple_size<T>::value>{}, make_seq<N-tuple_size<T>::value>{}, seq<>{});
789 }
790 } else {
791 if constexpr (N == 1) {
792 return a;
793 } else {
794 return detail::construct(cute::make_tuple(a), x, seq<0>{}, make_seq<N-1>{}, seq<>{});
795 }
796 }
797
798 CUTE_GCC_UNREACHABLE;
799}
800
801template <class T, class X>
802CUTE_HOST_DEVICE constexpr

Callers 3

unflatten_implFunction · 0.70
coalesce_256_implFunction · 0.50

Calls 1

constructFunction · 0.85

Tested by

no test coverage detected