Function sequant::eval::detail::current_scope(eval::BatchContext const&)

Function Documentation

inline CellScope sequant::eval::detail::current_scope(eval::BatchContext const &ectx)

The CellScope of the current point in the schedule walk — enclosing loop instances outermost-first, one {level.key(), level.latitude_ordinal} entry per already-opened ectx level, plus (the two-argument overload) block's own {level.key(), latitude_ordinal} entry appended last — the one construction every table lookup this file makes (build_cell_at / assemble_cell_at) goes through, so a scope a lookup uses here and the scope cell_table_builder.hpp's emit_cells recorded for the same point (an identical per-level construction) can never drift apart. BatchContextEntry has no separate flat latitude field (only level), so an enclosing entry reads level.latitude_ordinal; block's own entry reads its flat latitude_ordinal, mirroring emit_cells' child.latitude_ordinal exactly (the two are the same value by construction, but this keeps the two constructions textually identical rather than merely numerically equal).

Note

Qualified as eval::BatchContext (cell_registry.hpp), not the bare BatchContext this namespace’s own detail scope already binds to the unrelated alias in peak_profile.hpp (a svector<pair<Index,pair<size_t,size_t>>>) &#8212; unqualified lookup from inside sequant::eval::detail finds that closer name first, and it is not the same type as CacheManager<N, FHC>::BatchContext (the type ectx actually has at every call site here).