|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
2D blocked partitioning into a grid of parts_y x parts_x.
More...
#include <ca-tiling.H>
Static Public Member Functions | |
| static constexpr Tile2D_Range | tile (const std::array< ca_size_t, 2 > &extents, const ca_size_t parts_y, const ca_size_t parts_x, const ca_size_t tile_index) noexcept |
Tile owned by tile_index over the parts_y * parts_x grid. | |
| static constexpr std::array< ca_size_t, 2 > | factor_partitions (const std::array< ca_size_t, 2 > &extents, const ca_size_t parts) noexcept |
Pick a balanced (parts_y, parts_x) factorisation of parts. | |
2D blocked partitioning into a grid of parts_y x parts_x.
Each tile is balanced along both axes, mirroring the structure of Synchronous_Engine's Tile<W,H> schedule. Useful when a lattice is wide enough that splitting along axis 0 alone leaves rows so long that they exceed the L2 working set.
Tiles are enumerated row-major over the tile grid:
tile_index = ty * parts_x + tx
with ty in [0, parts_y) and tx in [0, parts_x).
Definition at line 257 of file ca-tiling.H.
|
inlinestaticconstexprnoexcept |
Pick a balanced (parts_y, parts_x) factorisation of parts.
The factorisation prefers shapes whose aspect ratio matches the lattice aspect ratio: tall lattices get more parts_y, wide ones get more parts_x. The result is symmetric around sqrt(parts) when the lattice is roughly square.
| [in] | extents | 2D lattice extents. |
| [in] | parts | total number of partitions. |
{parts_y, parts_x} such that parts_y * parts_x == parts. Definition at line 292 of file ca-tiling.H.
References Aleph::blossom_maximum_cardinality_matching(), cols, Aleph::diff(), rows, and y.
Referenced by TEST().
|
inlinestaticconstexprnoexcept |
Tile owned by tile_index over the parts_y * parts_x grid.
| [in] | extents | 2D lattice extents (rows, cols). |
| [in] | parts_y | number of partitions along axis 0. |
| [in] | parts_x | number of partitions along axis 1. |
| [in] | tile_index | linear tile index. |
tile_index. Definition at line 266 of file ca-tiling.H.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::split_range_balanced().
Referenced by TEST().