Struct ReleasePlan

Struct Documentation

struct ReleasePlan

When each cell of a table is let go, read off the schedule.

A cell lives for one epoch: from its production until the loop instance that re-produces it advances (detail::epoch_depth). Within an epoch the block of that loop – the root block for a cell bound to no loop – runs its timeline once: its steps in order, then its outputs in order. Every read of the cell happens at one position of that timeline, either directly (a build of that block, or one of its outputs) or inside the nested block that is the step at that position. The cell is released when the last position holding a read of it is done. Nothing is counted: a step that is skipped, or replays its reads once per batch of loops nested in it, is done all the same.

Public Functions

inline container::svector<CellId> const *released_after(ScopeBlock const &block, std::size_t pos) const
Returns:

the cells released after position pos of block, or null when there are none. block must be a block of the tree the plan was built on (asserted), and pos a position of its timeline.

Public Members

std::unordered_map<ScopeBlock const*, container::vector<container::svector<CellId>>> after

Per block of the schedule tree the plan was built on (the root block included, every block with an entry), per position of its timeline (steps, then outputs): the cells released once that position is done. Keyed by the block objects themselves: the plan serves one walk of that tree and is not for a copy of it.

container::vector<char> last_read

Per Read, by its position in CellTable::reads: whether it is the last use of its source, so that the reader takes the value over. Only a read made once per epoch of its source can be: one by a build or an output of the source’s own epoch block.

container::vector<char> last_assemble

Per cell: for an Assemble, whether its read of Production::source is the last use of that source.

container::vector<char> kept

Per cell: whether it is read from outside the table once the walk is over (build_release_plan's keep): never released, and never dead work, whatever becomes of its readers in the table.