pub struct Trip {
pub tensor: TensorId,
pub elem: usize,
pub admit: (i64, i64),
pub bias: i64,
pub per: usize,
}Expand description
★ A LOOP COUNT THE PROGRAM READS FROM ITS OWN DATA. Element elem of the input tensor — a program argument, set
before the program runs and never written by it — gives v, and every loop run to the trip runs
n = ⌈(v + bias) / per⌉ times. The program admits the values admit.0 ..= admit.1, stated in the value’s own
units — a position against the cache it indexes — so a value outside them is refused before anything runs, by the
same range the program’s own checks hold it to, never as a clamped or wrapped count. The counts run from
Trip::lo to Trip::hi, the bound every static question takes (a loop’s LoopCount::Trip::max is exactly
it).
It is the loop bound a Plasticine or Spatial controller takes from a scalar argument, and the one a GPU decode
kernel reads from its sequence length: a decode step at position P folds the ⌈P / tile⌉ cache blocks its
position reaches instead of every block the cache is declared with.
Fields§
§tensor: TensorId§elem: usize§admit: (i64, i64)§bias: i64§per: usizeImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trip
impl<'de> Deserialize<'de> for Trip
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Trip
impl StructuralPartialEq for Trip
Auto Trait Implementations§
impl Freeze for Trip
impl RefUnwindSafe for Trip
impl Send for Trip
impl Sync for Trip
impl Unpin for Trip
impl UnsafeUnpin for Trip
impl UnwindSafe for Trip
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.