Struct ReductionConfig
pub struct ReductionConfig {
pub num_slots: usize,
pub use_cooperative: bool,
pub use_software_barrier: bool,
pub shared_mem_bytes: usize,
}Expand description
Configuration for reduction operations.
Fields§
§num_slots: usizeNumber of reduction slots (for parallel accumulation).
Multiple slots reduce atomic contention by spreading updates across several memory locations. The final result is computed by combining all slots on the host.
use_cooperative: boolUse cooperative groups for grid-wide synchronization.
Requires compute capability 6.0+ (Pascal or newer). When disabled, falls back to software barriers or multi-launch.
use_software_barrier: boolUse software barrier when cooperative groups unavailable.
Software barriers use atomic counters in global memory. This works on all devices but has higher latency.
Shared memory size per block for reduction (bytes).
Should be at least block_size * sizeof(T) for full reduction.
Default: 0 (auto-calculate based on block size).
Implementations§
§impl ReductionConfig
impl ReductionConfig
pub fn new() -> ReductionConfig
pub fn new() -> ReductionConfig
Create a new reduction config with default settings.
pub fn with_slots(self, num_slots: usize) -> ReductionConfig
pub fn with_slots(self, num_slots: usize) -> ReductionConfig
Set the number of accumulation slots.
pub fn with_cooperative(self, enabled: bool) -> ReductionConfig
pub fn with_cooperative(self, enabled: bool) -> ReductionConfig
Enable or disable cooperative groups.
pub fn with_software_barrier(self, enabled: bool) -> ReductionConfig
pub fn with_software_barrier(self, enabled: bool) -> ReductionConfig
Enable or disable software barrier fallback.
Set explicit shared memory size.
Trait Implementations§
§impl Clone for ReductionConfig
impl Clone for ReductionConfig
§fn clone(&self) -> ReductionConfig
fn clone(&self) -> ReductionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ReductionConfig
impl Debug for ReductionConfig
§impl Default for ReductionConfig
impl Default for ReductionConfig
§fn default() -> ReductionConfig
fn default() -> ReductionConfig
Auto Trait Implementations§
impl Freeze for ReductionConfig
impl RefUnwindSafe for ReductionConfig
impl Send for ReductionConfig
impl Sync for ReductionConfig
impl Unpin for ReductionConfig
impl UnwindSafe for ReductionConfig
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more