Mojo function
Idx
Idx(value: Int) -> RuntimeInt
Helper to create runtime indices.
Usage: Idx(5) creates a RuntimeInt with value 5.
Args:
- βvalue (
Int): The integer value for the runtime index.
Returns:
RuntimeInt: A RuntimeInt instance with the specified value.
Idx[value: Int]() -> ComptimeInt[value]
Helper to create compile-time indices.
Usage: Idx5 creates a ComptimeInt with value 5.
Parameters:
- βvalue (
Int): The compile-time integer value.
Returns:
ComptimeInt: A ComptimeInt instance with the specified compile-time value.
Idx(value: IntLiteral[value.value]) -> ComptimeInt[Int(#pop.cast_to_builtin<#pop.int_literal_convert<*"value.value`"> : !pop.scalar<index>>)]
Helper to create compile-time indices.
Usage: Idx5 creates a ComptimeInt with value 5.
Args:
- βvalue (
IntLiteral): The compile-time integer value.
Returns:
ComptimeInt: A ComptimeInt instance with the specified compile-time value.
Idx(value: Scalar[value.dtype]) -> RuntimeInt[value.dtype] where value.dtype.is_integral()
Create a runtime index from a scalar value.
Args:
- βvalue (
Scalar): The integer value for the runtime index.
Returns:
RuntimeInt: A RuntimeInt instance with the specified value.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!