Skip to main content
Log in

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 two Int 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 three Int 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 single Int 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 single Int 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 single Int 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 single Int 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 single Int 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 single Int argument, which is the loop index value.
  • strided_range (_StridedRange): A range representing the number of strided repetitions from [start; end).