167 return num_partitions <= 1
or cells == 0
or cells <
min_cells;
178template <std::
size_t Rank>
181 static_assert(
Rank >= 1,
"Row_Partition requires Rank >= 1");
208template <std::
size_t Rank>
211 static_assert(
Rank >= 1,
"Column_Partition requires Rank >= 1");
304 const long long rows =
static_cast<long long>(
extents[0]);
305 const long long cols =
static_cast<long long>(
extents[1]);
313 const long long ry =
rows /
static_cast<long long>(
y);
314 const long long rx =
cols /
static_cast<long long>(x);
318 const long long score = -
diff;
339namespace ca_tiling_detail {
346 for (std::size_t i = 0; i < 32; ++i)
347 r |= (
static_cast<std::uint64_t
>(v >> i) & 1ULL) << (2 * i);
356 for (std::size_t i = 0; i < 21; ++i)
357 r |= (
static_cast<std::uint64_t
>(v >> i) & 1ULL) << (3 * i);
376 const std::uint32_t
y)
noexcept
393 const std::uint32_t
y,
394 const std::uint32_t z)
noexcept
Exception handling system with formatted messages for Aleph-w.
Common typedefs and tag types for the Cellular Automata module.
Shape (per-axis sizes) of an mdspan, mixing compile-time and run-time extents.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
constexpr std::uint64_t spread_bits_2(const std::uint32_t v) noexcept
Spread the low bits bits of v so that they occupy even positions.
constexpr std::uint64_t spread_bits_3(const std::uint32_t v) noexcept
Spread the low bits bits of v so that they occupy every third position (used for 3D Morton codes).
constexpr std::uint64_t morton_encode_3d(const std::uint32_t x, const std::uint32_t y, const std::uint32_t z) noexcept
Morton (Z-order) encoding of (x, y, z).
constexpr Range1D split_range_balanced(const ca_size_t n, const ca_size_t parts, const ca_size_t idx) noexcept
Balanced split of [0, n) into parts contiguous ranges.
constexpr bool should_run_sequential(const ca_size_t cells, const ca_size_t num_partitions, const ca_size_t min_cells) noexcept
Decide whether a workload should run sequentially.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
constexpr std::uint64_t morton_encode_2d(const std::uint32_t x, const std::uint32_t y) noexcept
Morton (Z-order) encoding of (x, y).
Main namespace for Aleph-w library functions.
bool diff(const C1 &c1, const C2 &c2, Eq e=Eq())
Check if two containers differ.
2D blocked partitioning into a grid of parts_y x parts_x.
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.
Column partitioning along the last axis.
static constexpr Range1D slab(const std::array< ca_size_t, Rank > &extents, const ca_size_t parts, const ca_size_t idx) noexcept
Half-open column range owned by partition idx.
Half-open integer interval [begin, end).
ca_size_t end
Exclusive upper bound.
constexpr ca_size_t size() const noexcept
constexpr bool empty() const noexcept
ca_size_t begin
Inclusive lower bound.
Row partitioning along axis 0.
static constexpr Range1D slab(const std::array< ca_size_t, Rank > &extents, const ca_size_t parts, const ca_size_t idx) noexcept
Number of partitions along axis 0 with a balanced split.
2D tile descriptor: a rectangle in axis-0 / axis-1 coordinates.
constexpr ca_size_t size() const noexcept
Range1D cols
Half-open axis-1 range.
constexpr bool empty() const noexcept
Range1D rows
Half-open axis-0 range.