Skip to main content

Mojo function

parallelize_over_rows

parallelize_over_rows[: origin.set, //, func: fn(Int, Int) capturing -> None](shape: IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned], 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 (IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned]): 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.