pub struct GenericAtomicRMWOperation<'c> { /* private fields */ }
Expand description
A generic_atomic_rmw
operation. Atomic read-modify-write operation with a region.
The memref.generic_atomic_rmw
operation provides a way to perform a
read-modify-write sequence that is free from data races. The memref operand
represents the buffer that the read and write will be performed against, as
accessed by the specified indices. The arity of the indices is the rank of
the memref. The result represents the latest value that was stored. The
region contains the code for the modification itself. The entry block has
a single argument that represents the value stored in memref[indices]
before the write is performed. No side-effecting ops are allowed in the
body of GenericAtomicRMWOp
.
Example:
%x = memref.generic_atomic_rmw %I[%i] : memref<10xf32> {
^bb0(%current_value : f32):
%c1 = arith.constant 1.0 : f32
%inc = arith.addf %c1, %current_value : f32
memref.atomic_yield %inc : f32
}
Implementations§
source§impl<'c> GenericAtomicRMWOperation<'c>
impl<'c> GenericAtomicRMWOperation<'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>
) -> GenericAtomicRMWOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> GenericAtomicRMWOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn memref(&self) -> Result<Value<'c, '_>, Error>
pub fn indices(&self) -> impl Iterator<Item = Value<'c, '_>>
pub fn atomic_body(&self) -> Result<RegionRef<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<GenericAtomicRMWOperation<'c>> for Operation<'c>
impl<'c> From<GenericAtomicRMWOperation<'c>> for Operation<'c>
source§fn from(operation: GenericAtomicRMWOperation<'c>) -> Self
fn from(operation: GenericAtomicRMWOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for GenericAtomicRMWOperation<'c>
impl<'c> !Send for GenericAtomicRMWOperation<'c>
impl<'c> !Sync for GenericAtomicRMWOperation<'c>
impl<'c> Unpin for GenericAtomicRMWOperation<'c>
impl<'c> UnwindSafe for GenericAtomicRMWOperation<'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