Expand description
The executable device model as C: what the host binary links and calls when it runs on a machine that has no accelerator.
The model is generated from the same objects the device artifact is: each region’s control-flow graph and
the lane routines its cells are, at the device’s lane shape. Every lane routine becomes a C function over
uint32_t words masked to the lane width (one statement per lane operation, a for per Repeat), and
every region becomes a C function that walks its blocks with goto, calls a routine per cell, and returns
0 with the divergence code the moment a cell hands the call back. logos_dev_call is the driver the
host’s dispatch calls; it counts what every region did and, at exit, appends one line of accounting to the
file LOGOS_ACCEL_STATS names. LOGOS_ACCEL_OFFLOAD=off makes it hand every call back. Neither ever
writes to the program’s standard output or standard error.
Functions§
- model_c
- The model translation unit for
regions(each with its host-side region number) on a device whose lanes areshape: every routine the regions use, every region, and thelogos_dev_calldriver with its accounting.devicenames the device in the accounting line. - region_
c - C for a region at
shape:static int <symbol>(const int64_t *args, int64_t *out, uint32_t *fault), returning 1 with*outset, or 0 with*faultthe divergence code. - routine_
c - C for one lane routine:
static void <symbol>(const uint32_t *in, uint32_t *out). Its register file is a local that starts at zero on every call, as the lane interpreter’s does, so a call depends on nothing but its inputs and the model is reentrant. - routine_
symbol - The C symbol of
op’s routine atshape.