Function sequant::eval::detail::mode_is_external¶
Defined in File ordered_schedule.hpp
Function Documentation¶
-
inline bool sequant::eval::detail::mode_is_external(RichSchedule const &rich, Index const &mode)¶
True iff
mode'sindex type (IndexSpace::base_key()) ever survives, un-summed, into a forest-root value’s own carried slots.RichScheduledoes not carryBatchModeTypedirectly: the cross-occurrence meet instamp_lifetime_masksfolds every kind (External or Contracted) into oneIndexset (seestamp_residency_impl'sdoc comment — “any BatchModeType”), so a mode’s kind is not a field anywhere onValueCell. It is still recoverable fromrichalone: a batch mode realized in the forest is either Contracted (summed away below every root — an accumulate loop, so it never appears on a root’s own result) or External (a free/spectator index of some final output — a scatter loop, one output slice per block, so it does appear on a root’s own result). A forest-root occurrence is identified byOccurrenceRec::point==consumer_point:compute_dag_boulevard'spost-order walk only ever overwrites a child’sconsumer_point(to its parent’s point, always later in the walk), so a node that is never anyone’s child — a top-level tree of the forest — keeps its default-seededconsumer_point== its ownpoint.Matches by type (
base_key()) — not by exactIndexidentity (Index::operator==compares space and ordinal). More than one physicalIndexlabel of the same type can appear acrossrich'scells (e.g. one occurrence’s K_1 vs another’s K_2), so an exact-Index match could miss a root occurrence that uses a different physical label of the very type being classified, silently misclassifying an External mode as Contracted.