pub struct ReductionOperation<'c> { /* private fields */ }
Expand description
A reduction
operation. Reduction operation.
Reduces an 1-D vector “horizontally” into a scalar using the given operation (add/mul/min/max for int/fp and and/or/xor for int only). Reductions also allow an optional fused accumulator.
Note that these operations are restricted to 1-D vectors to remain close to the corresponding LLVM intrinsics:
http://llvm.org/docs/LangRef.html#vector-reduction-intrinsics
Example:
%1 = vector.reduction <add>, %0 : vector<16xf32> into f32
%3 = vector.reduction <xor>, %2 : vector<4xi32> into i32
%4 = vector.reduction <mul>, %0, %1 : vector<16xf32> into f32
Implementations§
source§impl<'c> ReductionOperation<'c>
impl<'c> ReductionOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> ReductionOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ReductionOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn dest(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn vector(&self) -> Result<Value<'c, '_>, Error>
pub fn acc(&self) -> Result<Value<'c, '_>, Error>
pub fn kind(&self) -> Result<Attribute<'c>, Error>
pub fn set_kind(&mut self, value: Attribute<'c>)
Trait Implementations§
source§impl<'c> From<ReductionOperation<'c>> for Operation<'c>
impl<'c> From<ReductionOperation<'c>> for Operation<'c>
source§fn from(operation: ReductionOperation<'c>) -> Self
fn from(operation: ReductionOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ReductionOperation<'c>
impl<'c> !Send for ReductionOperation<'c>
impl<'c> !Sync for ReductionOperation<'c>
impl<'c> Unpin for ReductionOperation<'c>
impl<'c> UnwindSafe for ReductionOperation<'c>
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