tvm_tirx.tirx.layout.Axis#

class tvm_tirx.tirx.layout.Axis(*args, **kwargs)#

Bases: Enum

A named physical coordinate used by a layout.

Use Axis.get(name) or a registered attribute such as Axis.m. Axis metadata identifies memory or thread coordinates and any owning backend; value @ axis attaches a stride or offset to that coordinate.

Examples

from tvm_tirx.script import tirx as T

memory = T.Axis.get("m")  # Also available as T.Axis.m.
layout = T.TileLayout(T.S[8 : 2 @ memory])
assert int(layout.apply(3)["m"]) == 6
Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

property name: str#

Return the canonical axis name.

classmethod get(name)#

Get or create the axis singleton named name.

Unknown names are registered without thread or memory attributes.

Parameters:

name (str)

Return type:

Axis

is_thread()#

Check if the axis is a thread axis.

Return type:

bool

is_memory()#

Check if the axis is a memory axis.

Return type:

bool

property backend: str | None#

Backend owning this axis, or None for a generic axis.

get_scope()#

Get the scope of the axis.

Return type:

ThreadScope | None

get_subscope()#

Get the subscope of the axis.

Return type:

ThreadScope | None