pub struct ElemwiseOptimization<R: Runtime> { /* private fields */ }
Expand description
Fuse element wise operations into a single kernel.
Implementations§
Source§impl<R: Runtime> ElemwiseOptimization<R>
impl<R: Runtime> ElemwiseOptimization<R>
Source§impl<R: Runtime> ElemwiseOptimization<R>
impl<R: Runtime> ElemwiseOptimization<R>
Sourcepub fn execute<BT: CubeElement>(
&mut self,
context: &mut Context<'_, CubeFusionHandle<R>>,
)
pub fn execute<BT: CubeElement>( &mut self, context: &mut Context<'_, CubeFusionHandle<R>>, )
Execute the optimization.
Sourcepub fn num_ops_fused(&self) -> usize
pub fn num_ops_fused(&self) -> usize
Number of element wise operations fused.
Sourcepub fn from_state(device: &R::Device, state: ElemwiseOptimizationState) -> Self
pub fn from_state(device: &R::Device, state: ElemwiseOptimizationState) -> Self
Create an optimization from its state.
Sourcepub fn to_state(&self) -> ElemwiseOptimizationState
pub fn to_state(&self) -> ElemwiseOptimizationState
Convert the optimization to its state.
Auto Trait Implementations§
impl<R> Freeze for ElemwiseOptimization<R>
impl<R> !RefUnwindSafe for ElemwiseOptimization<R>
impl<R> Send for ElemwiseOptimization<R>
impl<R> Sync for ElemwiseOptimization<R>
impl<R> Unpin for ElemwiseOptimization<R>
impl<R> !UnwindSafe for ElemwiseOptimization<R>
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> 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