pub enum OpKind {
Add,
Mul,
Sub,
Div,
Relu,
Sigmoid,
Tanh,
Scale,
Axpy,
MatMul,
Reduce,
Transpose,
}Expand description
The kind of an operation in the fusion graph.
The first nine variants are elementwise and therefore fusible; the final three are barrier ops that change the iteration space or reduce/permute data and so cannot participate in an elementwise fusion group.
Variants§
Add
Elementwise addition.
Mul
Elementwise multiplication.
Sub
Elementwise subtraction.
Div
Elementwise division.
Relu
Rectified linear unit activation.
Sigmoid
Logistic sigmoid activation.
Tanh
Hyperbolic tangent activation.
Scale
Scalar scaling (alpha * x).
Axpy
Fused multiply-add (alpha * x + y).
MatMul
Matrix multiplication (barrier: not fusible into an elementwise group).
Reduce
Reduction such as sum/mean/max (barrier).
Transpose
Transpose / permutation (barrier).
Implementations§
Source§impl OpKind
impl OpKind
Sourcepub fn is_fusible(&self) -> bool
pub fn is_fusible(&self) -> bool
Returns true if the op is an elementwise op that may be fused into a
single kernel together with other fusible ops.
Sourcepub fn is_barrier(&self) -> bool
pub fn is_barrier(&self) -> bool
Returns true for barrier ops (MatMul, Reduce, Transpose) that
break fusion chains and always form singleton groups.
Trait Implementations§
impl Copy for OpKind
impl Eq for OpKind
impl StructuralPartialEq for OpKind
Auto Trait Implementations§
impl Freeze for OpKind
impl RefUnwindSafe for OpKind
impl Send for OpKind
impl Sync for OpKind
impl Unpin for OpKind
impl UnsafeUnpin for OpKind
impl UnwindSafe for OpKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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