pub struct ReductionKernel { /* private fields */ }Expand description
GPU kernel for parallel reduction operations.
Implementations§
Source§impl ReductionKernel
impl ReductionKernel
Sourcepub fn new(context: &GpuContext, op: ReductionOp) -> GpuResult<Self>
pub fn new(context: &GpuContext, op: ReductionOp) -> GpuResult<Self>
Create a new reduction kernel.
§Errors
Returns an error if shader compilation or pipeline creation fails.
Sourcepub async fn execute<T: Pod + Copy>(
&self,
input: &GpuBuffer<T>,
_op: ReductionOp,
) -> GpuResult<T>
pub async fn execute<T: Pod + Copy>( &self, input: &GpuBuffer<T>, _op: ReductionOp, ) -> GpuResult<T>
Sourcepub fn execute_blocking<T: Pod + Copy>(
&self,
input: &GpuBuffer<T>,
op: ReductionOp,
) -> GpuResult<T>
pub fn execute_blocking<T: Pod + Copy>( &self, input: &GpuBuffer<T>, op: ReductionOp, ) -> GpuResult<T>
Auto Trait Implementations§
impl Freeze for ReductionKernel
impl !RefUnwindSafe for ReductionKernel
impl Send for ReductionKernel
impl Sync for ReductionKernel
impl Unpin for ReductionKernel
impl UnsafeUnpin for ReductionKernel
impl !UnwindSafe for ReductionKernel
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