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

Function prepend

include/cute/algorithm/tuple_algorithms.hpp:816–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814
815template <int N, class T, class X>
816CUTE_HOST_DEVICE constexpr
817auto
818prepend(T const& a, X const& x)
819{
820 if constexpr (is_tuple<T>::value) {
821 if constexpr (N == tuple_size<T>::value) {
822 return a;
823 } else {
824 static_assert(N > tuple_size<T>::value);
825 return detail::construct(a, x, seq<>{}, make_seq<N-tuple_size<T>::value>{}, make_seq<tuple_size<T>::value>{});
826 }
827 } else {
828 if constexpr (N == 1) {
829 return a;
830 } else {
831 static_assert(N > 1);
832 return detail::construct(cute::make_tuple(a), x, seq<>{}, make_seq<N-1>{}, seq<0>{});
833 }
834 }
835
836 CUTE_GCC_UNREACHABLE;
837}
838
839template <class T, class X>
840CUTE_HOST_DEVICE constexpr

Callers 11

copy_ifFunction · 0.70
mma_initFunction · 0.50
mma_initFunction · 0.50
deduce_smem_layoutSFAMethod · 0.50
deduce_smem_layoutSFBMethod · 0.50
loadFunction · 0.50
bw_coalesceFunction · 0.50
layout.hppFile · 0.50
operator()Method · 0.50
retileFunction · 0.50

Calls 1

constructFunction · 0.85

Tested by 3

mma_initFunction · 0.40
mma_initFunction · 0.40
loadFunction · 0.40