pub struct RecognizedProgram {
pub stages: Vec<RecognizedStage>,
pub unrecognized: Vec<(usize, String)>,
pub unlifted_writes: Vec<(usize, String, &'static str)>,
pub declared: Vec<DeclaredTensor>,
pub symbols: HashMap<Symbol, String>,
pub shapes: HashMap<String, (usize, usize)>,
pub mentions: HashMap<String, BTreeSet<usize>>,
pub opaque: Vec<usize>,
pub quiet: BTreeSet<usize>,
}Expand description
The walk’s result: the stages in program order, the tensor statements it could not lift (by top-level index and binder), the declared tensors, and the names of every symbol the specs mention.
Fields§
§stages: Vec<RecognizedStage>§unrecognized: Vec<(usize, String)>§unlifted_writes: Vec<(usize, String, &'static str)>Top-level writes to a declared tensor that no section computes — (statement, tensor, why). Each is a
reason the program is NOT lowered: dropping it would leave the tensor holding values the program never had.
declared: Vec<DeclaredTensor>§symbols: HashMap<Symbol, String>§shapes: HashMap<String, (usize, usize)>Every tensor the program binds, by name, as (rows, cols) — the parser’s table; the desugared statements
carry only flat lengths.
mentions: HashMap<String, BTreeSet<usize>>Every name the program’s top-level statements touch, by name, with the statements that touch it — a Show, a
scalar read and a stage alike. What reads a value is here, so a pass can know a value nothing else reads.
opaque: Vec<usize>The top-level statements that run foreign code, which may touch any name.
quiet: BTreeSet<usize>The top-level statements that only declare a tensor or a scalar, or give a declared tensor a literal value before any op reads it: the statements that make the program’s inputs, which observe nothing.
Implementations§
Trait Implementations§
Source§impl Clone for RecognizedProgram
impl Clone for RecognizedProgram
Source§fn clone(&self) -> RecognizedProgram
fn clone(&self) -> RecognizedProgram
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecognizedProgram
impl Debug for RecognizedProgram
Source§impl Default for RecognizedProgram
impl Default for RecognizedProgram
Source§fn default() -> RecognizedProgram
fn default() -> RecognizedProgram
Auto Trait Implementations§
impl Freeze for RecognizedProgram
impl RefUnwindSafe for RecognizedProgram
impl Send for RecognizedProgram
impl Sync for RecognizedProgram
impl Unpin for RecognizedProgram
impl UnsafeUnpin for RecognizedProgram
impl UnwindSafe for RecognizedProgram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.