| 1007 | template <class Tensor, class Tiler, class Coord, |
| 1008 | __CUTE_REQUIRES(is_tensor<remove_cvref_t<Tensor>>::value)> |
| 1009 | CUTE_HOST_DEVICE constexpr |
| 1010 | auto |
| 1011 | outer_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: |
no test coverage detected