For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
OpCost
struct OpCost
Hardware cost annotation for a single operation kind.
Maps an operation tag to the hardware resource it occupies, its latency in cycles, its data-flow role, and (optionally) the VGPR liveness it induces. Provided by a TargetCostModel.
Fieldsβ
- βresource (
ResourceKind): - βlatency (
Int): - βrole (
OpRole): - βvgpr_def (
Int): VGPRs this op brings into scope (new live register values). - βvgpr_kill (
Int): VGPRs this op releases (last use of some register buffer).
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable
Methodsβ
__init__β
__init__(out self, resource: ResourceKind, latency: Int, role: OpRole, *, vgpr_def: Int = 0, vgpr_kill: Int = 0)
Constructs an OpCost.
Args:
- βresource (
ResourceKind): Hardware execution unit. - βlatency (
Int): Latency in cycles. - βrole (
OpRole): Pipeline data-flow role. - βvgpr_def (
Int): VGPRs the op brings into scope. - βvgpr_kill (
Int): VGPRs the op releases.
noneβ
static none() -> Self
Sentinel for unregistered op tags.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!