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.
- Uneven
Error - Error returned by
range_evenwhentotalis not evenly divisible byworker_count.
Functions§
- range
- Divide
0..totalintoworker_countcontiguous chunks and return the chunk owned byworker_index. Distribution handles remainders by giving the firsttotal % worker_countworkers 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). Workerireceives everyworker_count-th tile starting at indexi, so the union of all workers covers the image exactly once.