Module partition

Module partition 

Source
Expand description

Range/tile partition helpers for shared-memory tasklets.

Pure integer math — available on every target, both host and wasm32, with or without the std feature.

Structs§

Tile
A 2D image tile.
UnevenError
Error returned by range_even when total is not evenly divisible by worker_count.

Functions§

range
Divide 0..total into worker_count contiguous chunks and return the chunk owned by worker_index. Distribution handles remainders by giving the first total % worker_count workers one extra item.
range_even
Strict even-split variant of range.
tiles
Iterate the tiles assigned to worker_index. Tiles are produced in row-major order across the (width, height) image with cell size (tile_w, tile_h). Worker i receives every worker_count-th tile starting at index i, so the union of all workers covers the image exactly once.