MCPcopy Create free account
hub / github.com/Tencent/hpc-ops / replace

Function replace

3rd/cutlass/include/cute/algorithm/tuple_algorithms.hpp:655–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653// Replace the Nth element of the tuple with x
654template <int N, class T, class X>
655CUTE_HOST_DEVICE constexpr
656auto
657replace(T const& t, X const& x)
658{
659 if constexpr (is_tuple<T>::value) {
660 return detail::construct(t, x, make_seq<N>{}, seq<0>{}, make_range<N+1,tuple_size<T>::value>{});
661 } else {
662 static_assert(N == 0);
663 return x;
664 }
665
666 CUTE_GCC_UNREACHABLE;
667}
668
669// Replace the first element of the tuple with x
670template <class T, class X>

Callers

nothing calls this directly

Calls 1

constructFunction · 0.85

Tested by

no test coverage detected