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

Function outer_partition

include/cute/tensor_impl.hpp:1009–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007template <class Tensor, class Tiler, class Coord,
1008 __CUTE_REQUIRES(is_tensor<remove_cvref_t<Tensor>>::value)>
1009CUTE_HOST_DEVICE constexpr
1010auto
1011outer_partition(Tensor && tensor,
1012 Tiler const& tiler,
1013 Coord const& coord)
1014{
1015 auto tensor_tiled = zipped_divide(static_cast<Tensor&&>(tensor), tiler);
1016 constexpr int R1 = decltype(rank<1>(tensor_tiled))::value;
1017
1018 // The coord slices into the first mode (the "tile" mode), flatten the second
1019 if constexpr (is_tuple<Coord>::value) {
1020 // Append trailing modes if coord is tuple
1021 constexpr int R0 = decltype(rank<0>(tensor_tiled))::value;
1022 return tensor_tiled(append<R0>(coord,_), repeat<R1>(_));
1023 } else {
1024 // Flat indexing if coord is not tuple
1025 return tensor_tiled(coord, repeat<R1>(_));
1026 }
1027}
1028
1029// Tile a tensor according to @a tiler and use @a coord to index into the remainder, keeping the tile.
1030// This is typical at the CTA level where tiles of data are extracted:

Callers 5

get_callbacksMethod · 0.85
get_callbacksMethod · 0.85
get_callbacksMethod · 0.85
get_callbacksMethod · 0.85
local_partitionFunction · 0.85

Calls 1

zipped_divideFunction · 0.70

Tested by

no test coverage detected