Skip to main content

function

parallelize_over_rows

parallelize_over_rows[func: fn(Int, Int, /) capturing -> None](shape: StaticIntTuple[size], axis: Int, grain_size: Int)

Parallelize func over non-axis dims of shape.

Parameters:

  • func (fn(Int, Int, /) capturing -> None): Function to call on range of rows.

Args:

  • shape (StaticIntTuple[size]): Shape to parallelize over.
  • axis (Int): Rows are slices along the axis dimension of shape.
  • grain_size (Int): The minimum number of elements to warrant using an additional thread.