pub struct SimtEngine {
pub n_lanes: usize,
pub n_in: usize,
pub uniform: Vec<bool>,
pub body: Vec<FabricOp>,
pub result: usize,
pub predicated: bool,
pub reduce: Option<AluOp>,
pub arith: LaneArith,
}Expand description
A tuneable SIMT data-parallel engine — the GPU tile.
Fields§
§n_lanes: usizeLane width N (the SIMD/SIMT width). Tuneable — the whole engine is parametric in it.
n_in: usizeThe kernel’s input arity (parameter count of the compiled lane program).
uniform: Vec<bool>uniform[k] = input k is a broadcast scalar shared by every lane (a GPU “uniform”);
otherwise input k is a per-lane “varying” (its own value per lane). Length n_in.
body: Vec<FabricOp>The compiled straight-line kernel (the “shader”) — one FabricOp per SSA value, from
the real compiler’s dispatch-free residual. Every lane runs this verbatim.
result: usizeSSA index of the value driving each lane’s output.
predicated: boolPer-lane predication (SIMT divergence): a mask input gates each lane (masked → 0).
reduce: Option<AluOp>Optional cross-lane reduce tail (the warp-reduce) — the NPU accumulator, placed spatially.
arith: LaneArithThe lane’s multiply strategy — a tuneable, SAT-certified knob (see LaneArith). All three
strategies compute the same a·x + b (64-bit wrapping); they trade cycle count against
physical friendliness (SequentialFma is antenna-trivial, the combinational forms are dense).
Implementations§
Source§impl SimtEngine
impl SimtEngine
Sourcepub fn from_lane_source(
src: &str,
fn_name: &str,
n_lanes: usize,
uniform: Vec<bool>,
predicated: bool,
reduce: Option<AluOp>,
) -> SimtEngine
pub fn from_lane_source( src: &str, fn_name: &str, n_lanes: usize, uniform: Vec<bool>, predicated: bool, reduce: Option<AluOp>, ) -> SimtEngine
Build a SIMT engine from an English lane program. fn_name is the kernel (shader); its
straight-line body becomes the per-lane datapath. uniform marks which parameters are
broadcast scalars (shared) vs per-lane vectors; its length must equal the kernel arity.
Trait Implementations§
Source§impl Clone for SimtEngine
impl Clone for SimtEngine
Source§fn clone(&self) -> SimtEngine
fn clone(&self) -> SimtEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SimtEngine
impl RefUnwindSafe for SimtEngine
impl Send for SimtEngine
impl Sync for SimtEngine
impl Unpin for SimtEngine
impl UnsafeUnpin for SimtEngine
impl UnwindSafe for SimtEngine
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.