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

Function for_each

include/cute/algorithm/tuple_algorithms.hpp:172–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171template <class T, class F>
172CUTE_HOST_DEVICE constexpr
173void
174for_each(T&& t, F&& f)
175{
176 if constexpr (is_tuple<remove_cvref_t<T>>::value) {
177 return detail::apply(t, [&](auto&&... a) { (f(static_cast<decltype(a)&&>(a)), ...); }, tuple_seq<T>{});
178 } else {
179 return f(static_cast<T&&>(t));
180 }
181
182 CUTE_GCC_UNREACHABLE;
183}
184
185template <class T, class F>
186CUTE_HOST_DEVICE constexpr

Calls 2

applyFunction · 0.85
fFunction · 0.50

Tested by 15

test_swizzle_2dFunction · 0.40
test_packed_type_aliasFunction · 0.40
runMethod · 0.40
beginMethod · 0.40
stepMethod · 0.40
endMethod · 0.40
beginMethod · 0.40
begin_loopMethod · 0.40
previsitMethod · 0.40
reduceMethod · 0.40
postreduceMethod · 0.40
tma_storeMethod · 0.40