pub struct Fused(/* private fields */);Expand description
A graph of element-wise operations evaluated as one kernel, with one or more of its steps as results. Cheap to clone; equal graphs compare and hash equal.
Implementations§
Source§impl Fused
impl Fused
Sourcepub fn supports(primitive: &Primitive, dtypes: &[DType]) -> bool
pub fn supports(primitive: &Primitive, dtypes: &[DType]) -> bool
Whether primitive applied to inputs of these dtypes can be part of a fused
kernel: unary, binary, select and type conversions over the GPU’s element types
(all but float64 and complex64).
Sourcepub fn new(
inputs: &[DType],
steps: Vec<(Primitive, Vec<FusedRef>)>,
outputs: &[usize],
) -> Result<Self>
pub fn new( inputs: &[DType], steps: Vec<(Primitive, Vec<FusedRef>)>, outputs: &[usize], ) -> Result<Self>
The fused computation of steps over inputs of the given dtypes, with the results
of the steps at positions outputs as its outputs. Each step is a primitive
Fused::supports and its operands, which refer to inputs or earlier steps.
Sourcepub fn with_constants(
inputs: &[DType],
constants: &[(DType, u64)],
steps: Vec<(Primitive, Vec<FusedRef>)>,
outputs: &[usize],
) -> Result<Self>
pub fn with_constants( inputs: &[DType], constants: &[(DType, u64)], steps: Vec<(Primitive, Vec<FusedRef>)>, outputs: &[usize], ) -> Result<Self>
Fused::new with scalar constants (a float dtype, F32, F16 or BF16, and the
value’s bits) that steps refer to as FusedRef::Constant: they are part of the
kernel, as literals, rather than inputs read from memory.
Trait Implementations§
impl Eq for Fused
impl StructuralPartialEq for Fused
Auto Trait Implementations§
impl !RefUnwindSafe for Fused
impl !UnwindSafe for Fused
impl Freeze for Fused
impl Send for Fused
impl Sync for Fused
impl Unpin for Fused
impl UnsafeUnpin for Fused
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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<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