Template Function sequant::eval::schedule::record_dag¶
Defined in File schedule_dag_record.hpp
Function Documentation¶
-
template<meta::eval_node_range R>
DagRecord sequant::eval::schedule::record_dag(RichSchedule const &rich, LegalitySchedule const &legality, OrderedSchedule const &ordered, R const &forest, std::vector<RootRecord> const &roots, std::function<bool(std::ranges::range_value_t<R> const&)> const &is_volatile = {}, dryrun::CostModel const *cm = nullptr, std::function<std::size_t(Index const&)> const &block_of = {})¶ Value ids: the value’s first occurrence in forest order, “<term key>#<
ordinal>”, “<term key>#scale” or “<root label>+<k>”. That occurrence is also the engine’s frame for the value’s cell (
home_modes_in_cell_frame:“the rich cell’s own frame – the first occurrence’s labels”), so the id’s term is the term whose index labelsexpr, the mode lists and the legality fields of the record are spelled in; every other occurrence has its own labels, recorded per occurrence.rootssupplies term keys in forest order (roots[r].terms[t].key for root r, summand t).Static points are matched to forest nodes by reproducing
compute_dag_boulevard'snumbering: one post-order (left, right, node) over every tree in forest order, leaves included, one counter across trees. This needs nothing beyond the forest itself and resolves every occurrence (each occurrence is one point), whereas going throughbuild_value_key_node_map/resolve_value_nodewould give one node per value and lose which term each other occurrence sits in. The count is cross-checked againstRichSchedule::num_points.- Parameters:
is_volatile – the node-level volatility predicate the evaluation runs with (see
evaluate_ordered_schedule), which decides persistence; empty means no leaf is volatilecm – when non-null, every value record is priced by this cost model:
modeled_footprint=detail::cell_footprintatblock_of(the per-batch slab) andmodeled_size=memsizeover the carried modes; null leaves both 0block_of – the block (sliced) extent of a batched mode, as the schedule was built with; empty means 1
- Throws:
sequant::Exception – when the forest and
rootsdisagree (tree or summand count, a Sum spine node that is not an in-place Sum), or when a value, block step or legality record cannot be resolved