Skip to main content

Module region

Module region 

Source
Expand description

Regions: the functions an accelerator runs, as control-flow graphs over checked cells.

A region is lowered from a function of the SAME optimized CompiledProgram the host is lowered from, so its function index is the host’s. The lowering is typed: every register’s kind (Int, Float, Bool) is inferred by a forward dataflow over the function’s blocks from its declared parameter kinds, and each op becomes the cell whose checked semantics is the VM kernel’s for those kinds. A function the lowering cannot type, or that does anything besides compute a scalar from scalars (a Show, a global, a collection, a call, a closure), stays on the host with the reason named.

A region is executed two ways: RegionCfg::eval_checked runs the cells’ 64-bit checked semantics (the reference), and RegionCfg::eval_on_lanes runs every cell as its lane routine on a device’s lanes (the device model). Control flow is real, not predicated: only the cells on the path the VM takes execute, so a divergence is reported exactly where the VM would promote or fail.

Structs§

HostReason
A function the region lowering keeps on the host, and why.
RBlock
RegionCfg
A function as a region: its ports, its register file size, its blocks (block 0 is the entry).

Enums§

Discovered
What discovery made of one function.
Halt
Why a region run stopped short of a value.
Kind
The value kinds a region carries across its boundary and between its cells.
RStmt
One statement of a region block.
RTerm
Where a block goes.

Functions§

discover
Every function of program, each a region or a host reason; names[i] is function i’s name.
lower
Lower function fi of program to a region, or name why it stays on the host.

Type Aliases§

VReg
A region register: one 64-bit value (an Int, a Bool as 0/1, a Float as its bit pattern).