pub struct CompiledKernelRaw { /* private fields */ }Expand description
The closure tier with no provenance: every evaluation runs every step.
Implementations§
Source§impl CompiledKernelRaw
impl CompiledKernelRaw
Sourcepub fn eval_for_slot(&mut self, coords: &[u64], slot: usize) -> u64
pub fn eval_for_slot(&mut self, coords: &[u64], slot: usize) -> u64
Eval + return a specific slot. No cone guard — always evaluates.
Sourcepub fn coord_count(&self) -> usize
pub fn coord_count(&self) -> usize
The coordinate inputs.
Sourcepub fn resolve_output(&self, name: &str) -> Option<usize>
pub fn resolve_output(&self, name: &str) -> Option<usize>
The slot of a named output.
Sourcepub fn get_slot(&self, slot: usize) -> u64
pub fn get_slot(&self, slot: usize) -> u64
Read an output by pre-resolved slot index. Panics on
Ref2-colored slots (axiom S2) — use read_vec_*.
Sourcepub fn get(&self, name: &str) -> u64
pub fn get(&self, name: &str) -> u64
Read a named output variate after eval(). Panics on
Ref2-colored outputs (axiom S2) — use read_vec_*.
Sourcepub fn get_value(&self, name: &str) -> Value
pub fn get_value(&self, name: &str) -> Value
The named output as a typed Value, decoded by its port
type: a Ref2 output is copied out through its pair
(compiled_handles.md §4), so the caller never holds a
pointer; a slot that holds None reads as None.
Sourcepub fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>
pub fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>
Set an extern by name, as PolydatState::set_input does on
the interpreter. The value must be of the declared port
type. Every kind is written through at once, and every step
downstream of the extern reruns.
Sourcepub fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>
pub fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>
Self::set_input by input index.
Sourcepub fn cursor_schemas(&self) -> &[SourceSchema]
pub fn cursor_schemas(&self) -> &[SourceSchema]
The cursors the program declares, with the partitions the
compiler resolved where its over clause and extent were
constant, as PolydatProgram::cursor_schemas reports them.
Sourcepub fn set_cursor(
&mut self,
name: &str,
partition: &Partition,
) -> Result<(), String>
pub fn set_cursor( &mut self, name: &str, partition: &Partition, ) -> Result<(), String>
Narrow a cursor to one partition, as narrow_cursor does on
the interpreter: its Ext slot and six scalar projections
are set as externs.
Sourcepub fn read_vec_f32(&self, slot: usize) -> &[f32]
pub fn read_vec_f32(&self, slot: usize) -> &[f32]
Borrow a vec_f32 output’s current contents.
Sourcepub fn read_vec_f64(&self, slot: usize) -> &[f64]
pub fn read_vec_f64(&self, slot: usize) -> &[f64]
Borrow a vec_f64 output’s current contents.
Sourcepub fn read_vec_f16(&self, slot: usize) -> &[f16]
pub fn read_vec_f16(&self, slot: usize) -> &[f16]
Borrow a vec_f16 output’s current contents.
Sourcepub fn read_vec_i8(&self, slot: usize) -> &[i8]
pub fn read_vec_i8(&self, slot: usize) -> &[i8]
Borrow a vec_i8 output’s current contents.
Sourcepub fn read_vec_i16(&self, slot: usize) -> &[i16]
pub fn read_vec_i16(&self, slot: usize) -> &[i16]
Borrow a vec_i16 output’s current contents.
Sourcepub fn read_vec_i32(&self, slot: usize) -> &[i32]
pub fn read_vec_i32(&self, slot: usize) -> &[i32]
Borrow a vec_i32 output’s current contents.
Sourcepub fn read_vec_i64(&self, slot: usize) -> &[i64]
pub fn read_vec_i64(&self, slot: usize) -> &[i64]
Borrow a vec_i64 output’s current contents.
Trait Implementations§
Source§impl Clone for CompiledKernelRaw
impl Clone for CompiledKernelRaw
Source§fn clone(&self) -> CompiledKernelRaw
fn clone(&self) -> CompiledKernelRaw
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Kernel for CompiledKernelRaw
impl Kernel for CompiledKernelRaw
Source§fn output_names(&self) -> Vec<String>
fn output_names(&self) -> Vec<String>
In declaration order, as the interpreter lists them: the assembler sets them on every compiled kernel.
Source§fn set_inputs(&mut self, coords: &[u64])
fn set_inputs(&mut self, coords: &[u64])
Source§fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>
fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>
None, which clears the extern; a value of
another type is refused at the write, never healed. A coordinate
is set with Self::set_inputs, not here. An unknown name is
an error naming the known ones.Source§fn set_cursor(
&mut self,
name: &str,
partition: &Partition,
) -> Result<(), String>
fn set_cursor( &mut self, name: &str, partition: &Partition, ) -> Result<(), String>
Ext slot and its six
scalar projections are set.Source§fn pull(&mut self, name: &str) -> Value
fn pull(&mut self, name: &str) -> Value
None reads as None.Source§fn input_names(&self) -> Vec<String>
fn input_names(&self) -> Vec<String>
Source§fn output_type(&self, name: &str) -> Option<PortType>
fn output_type(&self, name: &str) -> Option<PortType>
Source§fn cursor_schemas(&self) -> &[SourceSchema]
fn cursor_schemas(&self) -> &[SourceSchema]
Source§fn input_value(&self, name: &str) -> Option<Value>
fn input_value(&self, name: &str) -> Option<Value>
None for a name that is not an input.Source§fn traversals(&self) -> &[Traversal]
fn traversals(&self) -> &[Traversal]
Source§fn plan(&self) -> EnginePlan
fn plan(&self) -> EnginePlan
Source§fn input_index(&self, name: &str) -> Option<usize>
fn input_index(&self, name: &str) -> Option<usize>
Self::input_names, the
coordinates first: what Self::set_input_at takes.Source§fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>
fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>
Self::set_input by index, for a host that binds the same
inputs every cycle: the name is resolved once, with
Self::input_index, and no lookup runs per write.Source§fn output_index(&self, name: &str) -> Option<usize>
fn output_index(&self, name: &str) -> Option<usize>
Self::output_names: what
Self::pull_at takes.Source§fn pull_at(&mut self, index: usize) -> Value
fn pull_at(&mut self, index: usize) -> Value
Self::pull by index, for a host that reads the same outputs
every cycle: the name is resolved once, with
Self::output_index, and no lookup runs per pull.Source§fn traverse(&mut self, index: usize) -> Result<TraversalStream, String>
fn traverse(&mut self, index: usize) -> Result<TraversalStream, String>
index against this kernel’s current
values (SRD 113 §3.6): the comprehension’s sources see the wires
they reference as this kernel holds them now, and the cascaded
wires are snapshotted into every activation. On every engine
(engine parity, step 8).Source§fn invalidate_all(&mut self)
fn invalidate_all(&mut self)
polydat binary does when
every input is fixed.shared bindings are bound to (scope
model §6): one register per binding, which every kernel holding
the cell reads and writes.shared binding name to cell, so this kernel and
every other holder of the cell read and write one register:
a write on any of them is what the others read next, and a
dependent output is recomputed. A name that is not a shared
binding is an error naming the ones that are.Source§fn into_program(self: Box<Self>) -> Arc<dyn KernelProgram> ⓘ
fn into_program(self: Box<Self>) -> Arc<dyn KernelProgram> ⓘ
KernelProgram::create_kernel.Source§fn ledger(&self) -> &Arc<CompileLedger> ⓘ
fn ledger(&self) -> &Arc<CompileLedger> ⓘ
Source§fn traverse_all(&mut self) -> Result<Vec<TraversalStream>, String>
fn traverse_all(&mut self) -> Result<Vec<TraversalStream>, String>
Auto Trait Implementations§
impl !RefUnwindSafe for CompiledKernelRaw
impl !UnwindSafe for CompiledKernelRaw
impl Freeze for CompiledKernelRaw
impl Send for CompiledKernelRaw
impl Sync for CompiledKernelRaw
impl Unpin for CompiledKernelRaw
impl UnsafeUnpin for CompiledKernelRaw
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more