pub struct AllocOperation<'c> { /* private fields */ }
Expand description

An alloc operation. Memory allocation operation.

The alloc operation allocates a region of memory, as specified by its memref type.

Example:

%0 = memref.alloc() : memref<8x64xf32, 1>

The optional list of dimension operands are bound to the dynamic dimensions specified in its memref type. In the example below, the ssa value ‘%d’ is bound to the second dimension of the memref (which is dynamic).

%0 = memref.alloc(%d) : memref<8x?xf32, 1>

The optional list of symbol operands are bound to the symbols of the memrefs affine map. In the example below, the ssa value ‘%s’ is bound to the symbol ‘s0’ in the affine map specified in the allocs memref type.

%0 = memref.alloc()[%s] : memref<8x64xf32,
                          affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>, 1>

This operation returns a single ssa value of memref type, which can be used by subsequent load and store operations.

The optional alignment attribute may be specified to ensure that the region of memory that will be indexed is aligned at the specified byte boundary.

%0 = memref.alloc()[%s] {alignment = 8} :
  memref<8x64xf32, affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>, 1>

Implementations§

source§

impl<'c> AllocOperation<'c>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> AllocOperationBuilder<'c, Unset, Unset, Unset>

Creates a builder.

source

pub fn memref(&self) -> Result<OperationResult<'c, '_>, Error>

source

pub fn dynamic_sizes( &self ) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>

source

pub fn symbol_operands( &self ) -> Result<impl Iterator<Item = Value<'c, '_>>, Error>

source

pub fn alignment(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_alignment(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_alignment(&mut self) -> Result<(), Error>

Trait Implementations§

source§

impl<'c> From<AllocOperation<'c>> for Operation<'c>

source§

fn from(operation: AllocOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for AllocOperation<'c>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for AllocOperation<'c>

§

impl<'c> !Send for AllocOperation<'c>

§

impl<'c> !Sync for AllocOperation<'c>

§

impl<'c> Unpin for AllocOperation<'c>

§

impl<'c> UnwindSafe for AllocOperation<'c>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.