Skip to main content

function

elementwise

elementwise[func: fn[Int, Int](StaticIntTuple[$1], /) capturing -> None, simd_width: Int, rank: Int](shape: StaticIntTuple[rank])

Executes func[width, rank](indices), possibly as sub-tasks, for a suitable combination of width and indices so as to cover shape. Returns when all sub-tasks have completed.

Parameters:

  • func (fn[Int, Int](StaticIntTuple[$1], /) capturing -> None): The body function.
  • simd_width (Int): The SIMD vector width to use.
  • rank (Int): The rank of the buffer.

Args:

  • shape (StaticIntTuple[rank]): The shape of the buffer.