Expand description
NxPU intermediate representation.
An arena-based SSA IR for representing compute shader programs. Modeled after naga’s architecture but tailored for NPU lowering.
Re-exports§
pub use arena::Arena;pub use arena::Handle;pub use arena::Range;pub use arena::UniqueArena;pub use graph::ActivationFunction;
Modules§
- arena
- Arena-based storage with typed handles.
- graph
- Graph-level intermediate representation for multi-operation models.
Structs§
- Barrier
- Bitflags for synchronization barriers.
- Entry
Point - A compute shader entry point.
- Function
- An IR function.
- Function
Argument - A function argument declaration.
- Function
Result - The return type and optional binding of a function.
- Global
Variable - A module-scope variable.
- Local
Variable - A function-local variable.
- Module
- A compiled NxPU IR module.
- Resource
Binding @group(N) @binding(N)resource binding.- Scalar
- A scalar type: kind + byte width.
- Storage
Access - Bitflags for storage buffer access modes.
- Struct
Member - A member of a struct type.
- Tensor
Shape - A multi-dimensional tensor shape supporting mixed static/dynamic dimensions.
- Type
- A named type.
Enums§
- Address
Space - Memory address space for variables.
- Array
Size - Size of an array.
- Atomic
Function - An atomic operation.
- Binary
Op - A binary operator.
- Binding
- A binding for a function argument or result.
- BuiltIn
- Built-in shader inputs/outputs.
- Dimension
- A single tensor dimension: either a fixed size, a named symbolic parameter, or fully dynamic (unknown at compile time).
- Expression
- An expression in the IR — a pure SSA value with no side effects.
- IrError
- Errors that can occur when constructing or validating IR.
- Literal
- A literal constant value.
- Math
Function - A built-in math function.
- Memory
Layout - Memory layout for tensor data.
- Scalar
Kind - The kind of a scalar type.
- Statement
- A statement in the IR.
- Swizzle
Component - A vector swizzle component.
- Type
Inner - The concrete shape of a type.
- UnaryOp
- A unary operator.
- Vector
Size - Number of components in a vector.
Functions§
- dump_
module - Produces a human-readable text dump of a
Modulefor debugging. - format_
type - Formats a type using the type arena for resolving inner references.
- format_
type_ inner - Formats a
TypeInnerusing the type arena for resolving references.