GlobalReduction

Trait GlobalReduction 

Source
pub trait GlobalReduction: Send + Sync {
    // Required methods
    fn create_reduction_buffer<T: ReductionScalar>(
        &self,
        op: ReductionOp,
        config: &ReductionConfig,
    ) -> Result<Box<dyn ReductionHandle<T>>>;
    fn supports_cooperative(&self) -> bool;
    fn supports_grid_reduction(&self) -> bool;

    // Provided method
    fn cooperative_compute_capability(&self) -> Option<(u32, u32)> { ... }
}
Expand description

Trait for GPU runtimes that support global reduction operations.

Implemented by backend-specific runtimes (CUDA, WebGPU, etc.) to provide efficient reduction primitives.

Required Methods§

Source

fn create_reduction_buffer<T: ReductionScalar>( &self, op: ReductionOp, config: &ReductionConfig, ) -> Result<Box<dyn ReductionHandle<T>>>

Create a reduction buffer for the specified type and operation.

Source

fn supports_cooperative(&self) -> bool

Check if cooperative groups are supported.

Source

fn supports_grid_reduction(&self) -> bool

Check if grid-wide reduction is available.

Provided Methods§

Source

fn cooperative_compute_capability(&self) -> Option<(u32, u32)>

Get minimum compute capability for cooperative groups.

Returns (major, minor) version tuple, or None if not applicable.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§