Mojo function
unroll
unroll[: origin.set, //, func: fn[Int, Int]() capturing -> None, dim0: Int, dim1: Int]()
Repeatedly evaluates a 2D nested loop.
Parameters:
- func (
fn[Int, Int]() capturing -> None
): The function to evaluate. The function should take twoInt
arguments: the outer and inner loop index values. - dim0 (
Int
): The first dimension size. - dim1 (
Int
): The second dimension size.
unroll[: origin.set, //, func: fn[Int, Int, Int]() capturing -> None, dim0: Int, dim1: Int, dim2: Int]()
Repeatedly evaluates a 3D nested loop.
Parameters:
- func (
fn[Int, Int, Int]() capturing -> None
): The function to evaluate. The function should take threeInt
arguments: one for each nested loop index value. - dim0 (
Int
): The first dimension size. - dim1 (
Int
): The second dimension size. - dim2 (
Int
): The second dimension size.
unroll[: origin.set, //, func: fn[Int]() capturing -> None, zero_starting_range: _ZeroStartingRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - zero_starting_range (
_ZeroStartingRange
): A range representing the number of single step repetitions starting from zero.
unroll[: origin.set, //, func: fn[Int]() raises capturing -> None, zero_starting_range: _ZeroStartingRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() raises capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - zero_starting_range (
_ZeroStartingRange
): A range representing the number of single step repetitions starting from zero.
unroll[: origin.set, //, func: fn[Int]() capturing -> None, sequential_range: _SequentialRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - sequential_range (
_SequentialRange
): A range representing the number of single step repetitions from [start; end).
unroll[: origin.set, //, func: fn[Int]() raises capturing -> None, sequential_range: _SequentialRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() raises capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - sequential_range (
_SequentialRange
): A range representing the number of single step repetitions from [start; end).
unroll[: origin.set, //, func: fn[Int]() capturing -> None, strided_range: _StridedRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - strided_range (
_StridedRange
): A range representing the number of strided repetitions from [start; end).
unroll[: origin.set, //, func: fn[Int]() raises capturing -> None, strided_range: _StridedRange]()
Repeatedly evaluates a function range
times.
Parameters:
- func (
fn[Int]() raises capturing -> None
): The function to evaluate. The function should take a singleInt
argument, which is the loop index value. - strided_range (
_StridedRange
): A range representing the number of strided repetitions from [start; end).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!