pub struct KernelReductionConfig {
pub enabled: bool,
pub op: ReductionOp,
pub accumulator_type: String,
pub use_cooperative: bool,
pub shared_array_name: String,
pub accumulator_name: String,
}Expand description
Configuration for global reductions in a ring kernel.
This enables algorithms like PageRank to perform global reductions (e.g., computing dangling node sum) within the kernel using a two-phase reduce-and-broadcast pattern.
Fields§
§enabled: boolWhether global reduction is enabled.
op: ReductionOpThe reduction operation to perform.
accumulator_type: StringType of the accumulator (e.g., “double”, “float”, “int”).
use_cooperative: boolUse cooperative groups for grid-wide sync (requires CC 6.0+). If false, falls back to software barrier.
Name of the shared memory array for block reduction.
accumulator_name: StringName of the global accumulator variable.
Implementations§
Source§impl KernelReductionConfig
impl KernelReductionConfig
Sourcepub fn with_op(self, op: ReductionOp) -> Self
pub fn with_op(self, op: ReductionOp) -> Self
Enable reduction with the specified operation.
Sourcepub fn with_cooperative(self, use_cooperative: bool) -> Self
pub fn with_cooperative(self, use_cooperative: bool) -> Self
Enable or disable cooperative groups.
Set the shared memory array name.
Sourcepub fn with_accumulator_name(self, name: &str) -> Self
pub fn with_accumulator_name(self, name: &str) -> Self
Set the accumulator variable name.
Generate the shared memory declaration for block reduction.
Sourcepub fn generate_accumulator_param(&self) -> String
pub fn generate_accumulator_param(&self) -> String
Generate the accumulator parameter declaration.
Trait Implementations§
Source§impl Clone for KernelReductionConfig
impl Clone for KernelReductionConfig
Source§fn clone(&self) -> KernelReductionConfig
fn clone(&self) -> KernelReductionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more