pub struct ComputeBrick { /* private fields */ }Expand description
ComputeBrick: Generates WebGPU shaders from brick definition
Implementations§
Source§impl ComputeBrick
impl ComputeBrick
Sourcepub fn workgroup_size(self, x: u32, y: u32, z: u32) -> Self
pub fn workgroup_size(self, x: u32, y: u32, z: u32) -> Self
Set workgroup size
Sourcepub fn input(
self,
name: impl Into<String>,
dtype: TensorType,
shape: &[u32],
) -> Self
pub fn input( self, name: impl Into<String>, dtype: TensorType, shape: &[u32], ) -> Self
Add an input tensor
Sourcepub fn output(
self,
name: impl Into<String>,
dtype: TensorType,
shape: &[u32],
) -> Self
pub fn output( self, name: impl Into<String>, dtype: TensorType, shape: &[u32], ) -> Self
Add an output tensor
Sourcepub fn tile_strategy(self, strategy: TileStrategy) -> Self
pub fn tile_strategy(self, strategy: TileStrategy) -> Self
Set the tiling strategy
Allocate shared memory
Sourcepub fn to_rust_bindings(&self) -> String
pub fn to_rust_bindings(&self) -> String
Generate Rust wgpu bindings
Sourcepub fn to_dispatch_js(&self) -> String
pub fn to_dispatch_js(&self) -> String
Generate JavaScript dispatch code for WebGPU
Sourcepub fn get_workgroup_size(&self) -> (u32, u32, u32)
pub fn get_workgroup_size(&self) -> (u32, u32, u32)
Get workgroup size
Sourcepub fn inputs(&self) -> &[TensorBinding]
pub fn inputs(&self) -> &[TensorBinding]
Get input bindings
Sourcepub fn outputs(&self) -> &[TensorBinding]
pub fn outputs(&self) -> &[TensorBinding]
Get output bindings
Trait Implementations§
Source§impl Brick for ComputeBrick
impl Brick for ComputeBrick
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl Clone for ComputeBrick
impl Clone for ComputeBrick
Source§fn clone(&self) -> ComputeBrick
fn clone(&self) -> ComputeBrick
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComputeBrick
impl RefUnwindSafe for ComputeBrick
impl Send for ComputeBrick
impl Sync for ComputeBrick
impl Unpin for ComputeBrick
impl UnsafeUnpin for ComputeBrick
impl UnwindSafe for ComputeBrick
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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