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§
Sourcefn create_reduction_buffer<T: ReductionScalar>(
&self,
op: ReductionOp,
config: &ReductionConfig,
) -> Result<Box<dyn ReductionHandle<T>>>
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.
Sourcefn supports_cooperative(&self) -> bool
fn supports_cooperative(&self) -> bool
Check if cooperative groups are supported.
Sourcefn supports_grid_reduction(&self) -> bool
fn supports_grid_reduction(&self) -> bool
Check if grid-wide reduction is available.
Provided Methods§
Sourcefn cooperative_compute_capability(&self) -> Option<(u32, u32)>
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.