pub enum ReductionOp {
Sum,
Min,
Max,
And,
Or,
Xor,
Product,
}Expand description
Reduction operation types.
Each operation has an identity value that serves as the neutral element:
- Sum: 0 (a + 0 = a)
- Min: MAX (min(a, MAX) = a)
- Max: MIN (max(a, MIN) = a)
- And: all bits set (-1 for signed, MAX for unsigned)
- Or: 0 (a | 0 = a)
- Xor: 0 (a ^ 0 = a)
- Product: 1 (a * 1 = a)
Variants§
Sum
Sum of all values.
Min
Minimum value.
Max
Maximum value.
And
Bitwise AND.
Or
Bitwise OR.
Xor
Bitwise XOR.
Product
Product of all values.
Implementations§
Source§impl ReductionOp
impl ReductionOp
Sourcepub fn atomic_name(&self) -> &'static str
pub fn atomic_name(&self) -> &'static str
Get the CUDA atomic function name for this operation.
Sourcepub fn wgsl_atomic_name(&self) -> Option<&'static str>
pub fn wgsl_atomic_name(&self) -> Option<&'static str>
Get the WGSL atomic function name for this operation.
Sourcepub fn c_operator(&self) -> &'static str
pub fn c_operator(&self) -> &'static str
Get the C operator for this reduction (for code generation).
Sourcepub const fn is_commutative(&self) -> bool
pub const fn is_commutative(&self) -> bool
Check if this operation is commutative.
Sourcepub const fn is_associative(&self) -> bool
pub const fn is_associative(&self) -> bool
Check if this operation is associative.
Trait Implementations§
Source§impl Clone for ReductionOp
impl Clone for ReductionOp
Source§fn clone(&self) -> ReductionOp
fn clone(&self) -> ReductionOp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReductionOp
impl Debug for ReductionOp
Source§impl Display for ReductionOp
impl Display for ReductionOp
Source§impl Hash for ReductionOp
impl Hash for ReductionOp
Source§impl PartialEq for ReductionOp
impl PartialEq for ReductionOp
impl Copy for ReductionOp
impl Eq for ReductionOp
impl StructuralPartialEq for ReductionOp
Auto Trait Implementations§
impl Freeze for ReductionOp
impl RefUnwindSafe for ReductionOp
impl Send for ReductionOp
impl Sync for ReductionOp
impl Unpin for ReductionOp
impl UnwindSafe for ReductionOp
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.