Trait GlobalReduction
pub trait GlobalReduction: Send + Sync {
// Required methods
fn create_reduction_buffer<T>(
&self,
op: ReductionOp,
config: &ReductionConfig,
) -> Result<Box<dyn ReductionHandle<T>>, RingKernelError>
where T: ReductionScalar;
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§
fn create_reduction_buffer<T>(
&self,
op: ReductionOp,
config: &ReductionConfig,
) -> Result<Box<dyn ReductionHandle<T>>, RingKernelError>where
T: ReductionScalar,
fn create_reduction_buffer<T>(
&self,
op: ReductionOp,
config: &ReductionConfig,
) -> Result<Box<dyn ReductionHandle<T>>, RingKernelError>where
T: ReductionScalar,
Create a reduction buffer for the specified type and operation.
fn supports_cooperative(&self) -> bool
fn supports_cooperative(&self) -> bool
Check if cooperative groups are supported.
fn supports_grid_reduction(&self) -> bool
fn supports_grid_reduction(&self) -> bool
Check if grid-wide reduction is available.
Provided Methods§
fn 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.