#[repr(C)]pub enum ReductionOperator {
Add = 0,
Multiply = 1,
Subtract = 2,
BitwiseAnd = 10,
BitwiseOr = 11,
BitwiseXor = 12,
LogicalAnd = 20,
LogicalOr = 21,
Min = 30,
Max = 31,
MinusEqual = 40,
Custom = 100,
}
Expand description
Reduction operator for reduction clauses
OpenMP supports built-in reduction operators and user-defined operators. This enum covers the standard operators defined in the OpenMP specification.
§Examples
let op = ReductionOperator::Add;
assert_eq!(op.to_string(), "+");
let op = ReductionOperator::Max;
assert_eq!(op.to_string(), "max");
§Learning: FFI-Compatible Enums
The repr(C)
attribute ensures this enum has the same memory layout
as a C enum, making it safe to pass across FFI boundaries.
Explicit discriminants ensure stable values across versions.
Variants§
Add = 0
Multiply = 1
Subtract = 2
BitwiseAnd = 10
BitwiseOr = 11
BitwiseXor = 12
LogicalAnd = 20
LogicalOr = 21
Min = 30
Max = 31
MinusEqual = 40
Custom = 100
Trait Implementations§
Source§impl Clone for ReductionOperator
impl Clone for ReductionOperator
Source§fn clone(&self) -> ReductionOperator
fn clone(&self) -> ReductionOperator
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 ReductionOperator
impl Debug for ReductionOperator
Source§impl Display for ReductionOperator
impl Display for ReductionOperator
Source§impl Hash for ReductionOperator
impl Hash for ReductionOperator
Source§impl PartialEq for ReductionOperator
impl PartialEq for ReductionOperator
impl Copy for ReductionOperator
impl Eq for ReductionOperator
impl StructuralPartialEq for ReductionOperator
Auto Trait Implementations§
impl Freeze for ReductionOperator
impl RefUnwindSafe for ReductionOperator
impl Send for ReductionOperator
impl Sync for ReductionOperator
impl Unpin for ReductionOperator
impl UnwindSafe for ReductionOperator
Blanket Implementations§
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