Mojo function
elementwise
elementwise[func: fn[Int, Int](StaticIntTuple[$1]) capturing -> None, simd_width: Int, *, use_blocking_impl: Bool = 0, target: StringLiteral = "cpu"](shape: Int)
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. - βuse_blocking_impl (
Bool
): Do not invoke the function using asychronous calls. - βtarget (
StringLiteral
): The target to run on.
Args:
- βshape (
Int
): The shape of the buffer.
elementwise[rank: Int, //, func: fn[Int, Int](StaticIntTuple[$1]) capturing -> None, simd_width: Int, *, use_blocking_impl: Bool = 0, target: StringLiteral = "cpu"](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:
- βrank (
Int
): The rank of the buffer. - βfunc (
fn[Int, Int](StaticIntTuple[$1]) capturing -> None
): The body function. - βsimd_width (
Int
): The SIMD vector width to use. - βuse_blocking_impl (
Bool
): Do not invoke the function using asychronous calls. - βtarget (
StringLiteral
): The target to run on.
Args:
- βshape (
StaticIntTuple[rank]
): The shape of the buffer.
elementwise[func: fn[Int, Int](StaticIntTuple[$1]) capturing -> None, simd_width: Int, *, use_blocking_impl: Bool = 0, target: StringLiteral = "cpu"](shape: Int, context: DeviceContext)
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. - βuse_blocking_impl (
Bool
): Do not invoke the function using asychronous calls. - βtarget (
StringLiteral
): The target to run on.
Args:
- βshape (
Int
): The shape of the buffer. - βcontext (
DeviceContext
): The device context to use.
elementwise[rank: Int, //, func: fn[Int, Int](StaticIntTuple[$1]) capturing -> None, simd_width: Int, *, use_blocking_impl: Bool = 0, target: StringLiteral = "cpu"](shape: StaticIntTuple[rank], context: DeviceContext)
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:
- βrank (
Int
): The rank of the buffer. - βfunc (
fn[Int, Int](StaticIntTuple[$1]) capturing -> None
): The body function. - βsimd_width (
Int
): The SIMD vector width to use. - βuse_blocking_impl (
Bool
): Do not invoke the function using asychronous calls. - βtarget (
StringLiteral
): The target to run on.
Args:
- βshape (
StaticIntTuple[rank]
): The shape of the buffer. - βcontext (
DeviceContext
): The device context to use.
elementwise[rank: Int, //, func: fn[Int, Int](StaticIntTuple[$1]) capturing -> None, simd_width: Int, *, use_blocking_impl: Bool = 0, target: StringLiteral = "cpu"](shape: StaticIntTuple[rank], context: MojoCallContextPtr)
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:
- βrank (
Int
): The rank of the buffer. - βfunc (
fn[Int, Int](StaticIntTuple[$1]) capturing -> None
): The body function. - βsimd_width (
Int
): The SIMD vector width to use. - βuse_blocking_impl (
Bool
): Do not invoke the function using asychronous calls. - βtarget (
StringLiteral
): The target to run on.
Args:
- βshape (
StaticIntTuple[rank]
): The shape of the buffer. - βcontext (
MojoCallContextPtr
): The device context to use.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?