pub struct TensorWasmKernelBlueprint {
pub entry: String,
pub ops: Vec<TensorWasmOp>,
pub grid_hint: GridHint,
pub shared_mem_bytes: u32,
}Expand description
A complete blueprint that the emitter (S12) can turn into PTX text.
Fields§
§entry: StringSymbolic entry name (used by load_ptx lookup).
ops: Vec<TensorWasmOp>Ordered ops to emit.
grid_hint: GridHintGrid hint (S11 fills in; S12 honours).
Bytes of shared memory the kernel will request.
Implementations§
Source§impl TensorWasmKernelBlueprint
impl TensorWasmKernelBlueprint
Sourcepub fn push(self, op: TensorWasmOp) -> Self
pub fn push(self, op: TensorWasmOp) -> Self
Append an op; returns self for builder-style chaining.
Update the shared-memory requirement.
Sourcepub fn fingerprint(&self) -> u64
pub fn fingerprint(&self) -> u64
Stable 64-bit hash used as the KernelCache key by S13.
Uses blake3 over a canonical byte serialisation so the hash is
deterministic across Rust versions and platforms — std’s
DefaultHasher (SipHash) is explicitly documented as unstable and
must not be relied on for persistence. The first 8 bytes of the 32-
byte BLAKE3 digest are interpreted as a little-endian u64.
The width is intentionally kept at 64 bits: the on-disk cache format
(DiskCache, [24..32) blueprint fingerprint (u64 LE)), the
crate::deopt::DeoptGuard DashMap<u64, _> key, and the
cross-crate OffloadedFunction.fingerprint ABI all key on this u64.
Callers wanting a lower collision probability without those
persistence/ABI constraints can use fingerprint128.
Sourcepub fn fingerprint128(&self) -> u128
pub fn fingerprint128(&self) -> u128
128-bit widening of fingerprint, derived from
the same canonical BLAKE3 digest.
jit HIGH (finding 2, truncation width): a 64-bit truncation of a
256-bit digest has a birthday-bound collision probability around
2^-32 across ~4 billion distinct kernels. Embedders that key kernels
in a context not bound by the 64-bit on-disk/ABI format (e.g. an
in-memory dedup map over a very large kernel population) should key
on this 128-bit value instead, which pushes the birthday bound out
to ~2^-64. The low 64 bits equal fingerprint.
Trait Implementations§
Source§impl Clone for TensorWasmKernelBlueprint
impl Clone for TensorWasmKernelBlueprint
Source§fn clone(&self) -> TensorWasmKernelBlueprint
fn clone(&self) -> TensorWasmKernelBlueprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TensorWasmKernelBlueprint
impl Debug for TensorWasmKernelBlueprint
Source§impl PartialEq for TensorWasmKernelBlueprint
impl PartialEq for TensorWasmKernelBlueprint
Source§fn eq(&self, other: &TensorWasmKernelBlueprint) -> bool
fn eq(&self, other: &TensorWasmKernelBlueprint) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TensorWasmKernelBlueprint
Auto Trait Implementations§
impl Freeze for TensorWasmKernelBlueprint
impl RefUnwindSafe for TensorWasmKernelBlueprint
impl Send for TensorWasmKernelBlueprint
impl Sync for TensorWasmKernelBlueprint
impl Unpin for TensorWasmKernelBlueprint
impl UnsafeUnpin for TensorWasmKernelBlueprint
impl UnwindSafe for TensorWasmKernelBlueprint
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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