For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
parallelize_over_rows
def parallelize_over_rows[func: def(Int, Int) capturing thin -> None](shape: IndexList[element_type=shape.element_type], axis: Int, grain_size: Int, ctx: Optional[DeviceContext] = None)
Parallelize func over non-axis dims of shape.
Parameters:
- βfunc (
def(Int, Int) capturing thin -> None): Function to call on range of rows.
Args:
- βshape (
IndexList[element_type=shape.element_type]): 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. - βctx (
Optional[DeviceContext]): Optional CPU DeviceContext to execute the work on.
def parallelize_over_rows[FuncType: def(Int, Int) -> None](func: FuncType, shape: IndexList[element_type=shape.element_type], axis: Int, grain_size: Int, ctx: Optional[DeviceContext] = None)
Parallelize func over non-axis dims of shape.
Parameters:
- βFuncType (
def(Int, Int) -> None): The body function type.
Args:
- βfunc (
FuncType): The closure carrying the captured state of the body function. - βshape (
IndexList[element_type=shape.element_type]): 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. - βctx (
Optional[DeviceContext]): Optional CPU DeviceContext to execute the work on.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!