Skip to main content

Crate nxpu_ir

Crate nxpu_ir 

Source
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.
EntryPoint
A compute shader entry point.
Function
An IR function.
FunctionArgument
A function argument declaration.
FunctionResult
The return type and optional binding of a function.
GlobalVariable
A module-scope variable.
LocalVariable
A function-local variable.
Module
A compiled NxPU IR module.
ResourceBinding
@group(N) @binding(N) resource binding.
Scalar
A scalar type: kind + byte width.
StorageAccess
Bitflags for storage buffer access modes.
StructMember
A member of a struct type.
TensorShape
A multi-dimensional tensor shape supporting mixed static/dynamic dimensions.
Type
A named type.

Enums§

AddressSpace
Memory address space for variables.
ArraySize
Size of an array.
AtomicFunction
An atomic operation.
BinaryOp
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.
MathFunction
A built-in math function.
MemoryLayout
Memory layout for tensor data.
ScalarKind
The kind of a scalar type.
Statement
A statement in the IR.
SwizzleComponent
A vector swizzle component.
TypeInner
The concrete shape of a type.
UnaryOp
A unary operator.
VectorSize
Number of components in a vector.

Functions§

dump_module
Produces a human-readable text dump of a Module for debugging.
format_type
Formats a type using the type arena for resolving inner references.
format_type_inner
Formats a TypeInner using the type arena for resolving references.

Type Aliases§

Block
A block of statements.
Bytes
Width of a scalar type in bytes.