pub struct WgpuExecutable { /* private fields */ }Implementations§
Source§impl WgpuExecutable
impl WgpuExecutable
Sourcepub fn compile_with_bindings(graph: Graph, bindings: &DimBinding) -> Self
pub fn compile_with_bindings(graph: Graph, bindings: &DimBinding) -> Self
Compile against an explicit DimBinding. Each Dim::Dynamic
in the graph that maps to a symbol in bindings is replaced
with Dim::Static(size) before the standard compile runs.
Symbols not in the binding stay dynamic — and then compile
will panic with the usual diagnostic.
pub fn compile(graph: Graph) -> Self
Sourcepub fn set_active_extent(&mut self, extent: Option<(usize, usize)>)
pub fn set_active_extent(&mut self, extent: Option<(usize, usize)>)
Hint the next run to process only the first actual rows
along the bucket axis (out of upper, the compile extent).
Honored when every Step is in the safe set. See PLAN L1.
pub fn set_param(&mut self, name: &str, data: &[f32])
Sourcepub fn debug_first_nan_node(
&mut self,
inputs: &[(&str, &[f32])],
) -> Option<(usize, String, String)>
pub fn debug_first_nan_node( &mut self, inputs: &[(&str, &[f32])], ) -> Option<(usize, String, String)>
Debug helper: run forward, then read every node slot back and report the first node whose output contains a NaN, plus a summary of the previous finite node’s value range so the caller can see the input that broke. Slow — diagnosis only.
Sourcepub fn output_dtypes(&self) -> Vec<DType>
pub fn output_dtypes(&self) -> Vec<DType>
Declared output dtypes (one per graph output). Used by the
runtime wrapper’s run_typed to narrow F32 results back to
F16/BF16 etc. on the way out.
Sourcepub fn set_param_bytes(&mut self, name: &str, data: &[u8])
pub fn set_param_bytes(&mut self, name: &str, data: &[u8])
Upload raw bytes for a Param. The bytes land tight-packed at
the param’s slot offset — no f32 round-trip. Used for quantized
weights (int8 / int4) where the kernel reads the byte stream
via bitcast<u32> from the f32-typed arena.
pub fn run(&mut self, inputs: &[(&str, &[f32])]) -> Vec<Vec<f32>>
pub fn run_read_outputs( &mut self, inputs: &[(&str, &[f32])], read_indices: Option<&[usize]>, ) -> Vec<Vec<f32>>
pub fn bind_gpu_handle(&mut self, name: &str, data: &[f32]) -> bool
pub fn has_gpu_handle(&self, name: &str) -> bool
pub fn set_gpu_handle_feed(&mut self, handle_name: &str, output_index: usize)
pub fn read_gpu_handle(&self, name: &str) -> Option<Vec<f32>>
Auto Trait Implementations§
impl !RefUnwindSafe for WgpuExecutable
impl !UnwindSafe for WgpuExecutable
impl Freeze for WgpuExecutable
impl Send for WgpuExecutable
impl Sync for WgpuExecutable
impl Unpin for WgpuExecutable
impl UnsafeUnpin for WgpuExecutable
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> 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