pub struct DeviceReduction<T: FvmScalar, B: AcceleratorBackend> { /* private fields */ }Expand description
Reusable one-scalar output allocation for vector reductions.
Implementations§
Source§impl<T: FvmScalar, B: AcceleratorBackend> DeviceReduction<T, B>
impl<T: FvmScalar, B: AcceleratorBackend> DeviceReduction<T, B>
Source§impl<T: FvmScalar> DeviceReduction<T, CpuBackend>
impl<T: FvmScalar> DeviceReduction<T, CpuBackend>
Sourcepub fn sum(
&mut self,
input: &<CpuBackend as AcceleratorBackend>::Buffer<T>,
) -> Result<T, AcceleratorError>
pub fn sum( &mut self, input: &<CpuBackend as AcceleratorBackend>::Buffer<T>, ) -> Result<T, AcceleratorError>
Deterministic sum in input order.
Sourcepub fn dot(
&mut self,
lhs: &<CpuBackend as AcceleratorBackend>::Buffer<T>,
rhs: &<CpuBackend as AcceleratorBackend>::Buffer<T>,
) -> Result<T, AcceleratorError>
pub fn dot( &mut self, lhs: &<CpuBackend as AcceleratorBackend>::Buffer<T>, rhs: &<CpuBackend as AcceleratorBackend>::Buffer<T>, ) -> Result<T, AcceleratorError>
Deterministic dot product in input order.
Sourcepub fn l2_norm(
&mut self,
input: &<CpuBackend as AcceleratorBackend>::Buffer<T>,
) -> Result<T, AcceleratorError>
pub fn l2_norm( &mut self, input: &<CpuBackend as AcceleratorBackend>::Buffer<T>, ) -> Result<T, AcceleratorError>
Euclidean norm.
Sourcepub fn max_abs(
&mut self,
input: &<CpuBackend as AcceleratorBackend>::Buffer<T>,
) -> Result<T, AcceleratorError>
pub fn max_abs( &mut self, input: &<CpuBackend as AcceleratorBackend>::Buffer<T>, ) -> Result<T, AcceleratorError>
Maximum absolute value, or zero for an empty vector.
Auto Trait Implementations§
impl<T, B> Freeze for DeviceReduction<T, B>
impl<T, B> RefUnwindSafe for DeviceReduction<T, B>
impl<T, B> Send for DeviceReduction<T, B>
impl<T, B> Sync for DeviceReduction<T, B>
impl<T, B> Unpin for DeviceReduction<T, B>
impl<T, B> UnsafeUnpin for DeviceReduction<T, B>
impl<T, B> UnwindSafe for DeviceReduction<T, B>
Blanket Implementations§
Source§impl<T> AccumulatePathExt for T
impl<T> AccumulatePathExt for T
fn accumulate_path<O, I>(path: I) -> Owhere
O: Orientation,
I: IntoIterator<Item = O>,
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