For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
Idx
Idx(value: Int) -> Int
Helper to create runtime indices.
Usage: Idx(5) creates a Scalar with value 5.
Args:
- value (
Int): The integer value for the runtime index.
Returns:
Int: A Scalar instance with the specified value.
Idx[value: Int]() -> ComptimeInt[value]
Helper to create compile-time indices.
Usage: Idx[5]() creates a ComptimeInt with value 5.
Parameters:
- value (
Int): The compile-time integer value.
Returns:
ComptimeInt[value]: A ComptimeInt instance with the specified compile-time value.
Idx(value: IntLiteral) -> ComptimeInt[Int(mlir_value=value.value)]
Helper to create compile-time indices.
Usage: Idx[5]() creates a ComptimeInt with value 5.
Args:
- value (
IntLiteral): The compile-time integer value.
Returns:
ComptimeInt[Int(mlir_value=value.value)]: A ComptimeInt instance with the specified compile-time value.
Idx(value: Scalar) -> Scalar[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:
Scalar[value.dtype]: A Scalar instance with the specified value.