pub struct ScanKernel { /* private fields */ }Expand description
Prefix sum (scan) operation
Implementations§
Source§impl ScanKernel
impl ScanKernel
Sourcepub fn execute(
&self,
_device: &GpuDevice,
input: &[u32],
output: &mut [u32],
) -> Result<()>
pub fn execute( &self, _device: &GpuDevice, input: &[u32], output: &mut [u32], ) -> Result<()>
Execute the scan (prefix sum) operation (CPU fallback).
- Inclusive:
output[i] = input[0] + … + input[i] - Exclusive:
output[0] = 0,output[i] = input[0] + … + input[i-1]
Wrapping arithmetic is used to avoid panics on overflow.
output must have the same length as input.
§Arguments
_device- GPU device (CPU fallback: unused)input- Input dataoutput- Output buffer for scan results
§Errors
Returns an error if output.len() != input.len().
Sourcepub fn is_inclusive(&self) -> bool
pub fn is_inclusive(&self) -> bool
Check if this is an inclusive scan
Auto Trait Implementations§
impl Freeze for ScanKernel
impl RefUnwindSafe for ScanKernel
impl Send for ScanKernel
impl Sync for ScanKernel
impl Unpin for ScanKernel
impl UnsafeUnpin for ScanKernel
impl UnwindSafe for ScanKernel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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