MemRefType

Struct MemRefType 

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

A mem-ref type.

Implementations§

Source§

impl<'c> MemRefType<'c>

Source

pub fn new( type: Type<'c>, dimensions: &[i64], layout: Option<Attribute<'c>>, memory_space: Option<Attribute<'c>>, ) -> Self

Creates a mem-ref type.

Source

pub fn checked( location: Location<'c>, type: Type<'c>, dimensions: &[u64], layout: Attribute<'c>, memory_space: Attribute<'c>, ) -> Option<Self>

Creates a mem-ref type with diagnostics.

Source

pub fn contiguous( element_type: Type<'c>, dimensions: &[i64], memory_space: Option<Attribute<'c>>, ) -> Self

Creates a contiguous mem-ref type (identity layout).

Source

pub fn contiguous_checked( location: Location<'c>, element_type: Type<'c>, dimensions: &[i64], memory_space: Option<Attribute<'c>>, ) -> Option<Self>

Creates a contiguous mem-ref type with diagnostics.

Source

pub fn strides_and_offset(&self) -> (Vec<i64>, i64)

Returns the strides and offset of the mem-ref type.

Returns a tuple of (strides, offset) where strides has length equal to the rank.

Source

pub fn layout(&self) -> Attribute<'c>

Returns a layout.

Source

pub fn affine_map(&self) -> AffineMap<'c>

Returns an affine map.

Source

pub fn memory_space(&self) -> Option<Attribute<'c>>

Returns a memory space.

Trait Implementations§

Source§

impl<'c> Clone for MemRefType<'c>

Source§

fn clone(&self) -> MemRefType<'c>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'c> Debug for MemRefType<'c>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'c> Display for MemRefType<'c>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'c> From<MemRefType<'c>> for Type<'c>

Source§

fn from(value: MemRefType<'c>) -> Self

Converts to this type from the input type.
Source§

impl<'c> Hash for MemRefType<'c>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'c> ShapedTypeLike<'c> for MemRefType<'c>

Source§

fn element(&self) -> Type<'c>

Returns a element type.
Source§

fn rank(&self) -> usize

Returns a rank.
Source§

fn dim_size(&self, index: usize) -> Result<DimSize, Error>

Returns a dimension size.
Source§

fn has_static_shape(&self) -> bool

Checks if a type has a static shape (all dimensions are static).
Source§

fn is_dynamic_stride_or_offset(value: i64) -> bool

Checks if a value represents a dynamic stride or offset.
Source§

fn is_static_stride_or_offset(value: i64) -> bool

Checks if a value represents a static stride or offset.
Source§

fn dynamic_stride_or_offset() -> i64

Returns the sentinel value for a dynamic stride or offset.
Source§

fn has_rank(&self) -> bool

Checks if a type has a rank.
Source§

impl<'c> TryFrom<Type<'c>> for MemRefType<'c>

Source§

type Error = Error

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

fn try_from(type: Type<'c>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'c> TypeLike<'c> for MemRefType<'c>

Source§

fn to_raw(&self) -> MlirType

Converts a type into a raw object.
Source§

fn context(&self) -> ContextRef<'c>

Returns a context.
Source§

fn id(&self) -> TypeId<'c>

Returns an ID.
Source§

fn dialect(&self) -> Dialect<'c>

Returns a dialect.
Source§

fn dump(&self)

Dumps a type.
Source§

fn is_any_quantized_type(&self) -> bool

Returns true if a type is any quantized type.
Source§

fn is_bf16(&self) -> bool

Returns true if a type is bf16.
Source§

fn is_calibrated_quantized_type(&self) -> bool

Returns true if a type is calibrated quantized type.
Source§

fn is_complex(&self) -> bool

Returns true if a type is complex.
Source§

fn is_f16(&self) -> bool

Returns true if a type is f16.
Source§

fn is_f32(&self) -> bool

Returns true if a type is f32.
Source§

fn is_f64(&self) -> bool

Returns true if a type is f64.
Source§

fn is_float(&self) -> bool

Returns true if a type is float.
Source§

fn is_float_4_e_2_m_1_fn(&self) -> bool

Returns true if a type is float 4 e 2 m 1 fn.
Source§

fn is_float_6_e_2_m_3_fn(&self) -> bool

Returns true if a type is float 6 e 2 m 3 fn.
Source§

fn is_float_6_e_3_m_2_fn(&self) -> bool

Returns true if a type is float 6 e 3 m 2 fn.
Source§

fn is_float8e3m4(&self) -> bool

Returns true if a type is float8e3m4.
Source§

fn is_float8e4m3(&self) -> bool

Returns true if a type is float8e4m3.
Source§

fn is_float8e4m3_b_11_fnuz(&self) -> bool

Returns true if a type is float8e4m3 b 11 fnuz.
Source§

fn is_float8e4m3fn(&self) -> bool

Returns true if a type is float8e4m3fn.
Source§

fn is_float8e4m3fnuz(&self) -> bool

Returns true if a type is float8e4m3fnuz.
Source§

fn is_float8e5m2(&self) -> bool

Returns true if a type is float8e5m2.
Source§

fn is_float8e5m2fnuz(&self) -> bool

Returns true if a type is float8e5m2fnuz.
Source§

fn is_float8e8m0fnu(&self) -> bool

Returns true if a type is float8e8m0fnu.
Source§

fn is_function(&self) -> bool

Returns true if a type is function.
Source§

fn is_gpu_async_token_type(&self) -> bool

Returns true if a type is gpu async token type.
Source§

fn is_index(&self) -> bool

Returns true if a type is index.
Source§

fn is_integer(&self) -> bool

Returns true if a type is integer.
Source§

fn is_llvm_pointer_type(&self) -> bool

Returns true if a type is llvm pointer type.
Source§

fn is_llvm_struct_type(&self) -> bool

Returns true if a type is llvm struct type.
Source§

fn is_mem_ref(&self) -> bool

Returns true if a type is mem ref.
Source§

fn is_none(&self) -> bool

Returns true if a type is none.
Source§

fn is_nvgpu_tensor_map_descriptor_type(&self) -> bool

Returns true if a type is nvgpu tensor map descriptor type.
Source§

fn is_opaque(&self) -> bool

Returns true if a type is opaque.
Source§

fn is_pdl_attribute_type(&self) -> bool

Returns true if a type is pdl attribute type.
Source§

fn is_pdl_operation_type(&self) -> bool

Returns true if a type is pdl operation type.
Source§

fn is_pdl_range_type(&self) -> bool

Returns true if a type is pdl range type.
Source§

fn is_pdl_type(&self) -> bool

Returns true if a type is pdl type.
Source§

fn is_pdl_type_type(&self) -> bool

Returns true if a type is pdl type type.
Source§

fn is_pdl_value_type(&self) -> bool

Returns true if a type is pdl value type.
Source§

fn is_quantized_type(&self) -> bool

Returns true if a type is quantized type.
Source§

fn is_ranked_tensor(&self) -> bool

Returns true if a type is ranked tensor.
Source§

fn is_shaped(&self) -> bool

Returns true if a type is shaped.
Source§

fn is_tensor(&self) -> bool

Returns true if a type is tensor.
Source§

fn is_tf32(&self) -> bool

Returns true if a type is tf32.
Source§

fn is_transform_any_op_type(&self) -> bool

Returns true if a type is transform any op type.
Source§

fn is_transform_any_param_type(&self) -> bool

Returns true if a type is transform any param type.
Source§

fn is_transform_any_value_type(&self) -> bool

Returns true if a type is transform any value type.
Source§

fn is_transform_operation_type(&self) -> bool

Returns true if a type is transform operation type.
Source§

fn is_transform_param_type(&self) -> bool

Returns true if a type is transform param type.
Source§

fn is_tuple(&self) -> bool

Returns true if a type is tuple.
Source§

fn is_uniform_quantized_per_axis_type(&self) -> bool

Returns true if a type is uniform quantized per axis type.
Source§

fn is_uniform_quantized_type(&self) -> bool

Returns true if a type is uniform quantized type.
Source§

fn is_unranked_mem_ref(&self) -> bool

Returns true if a type is unranked mem ref.
Source§

fn is_unranked_tensor(&self) -> bool

Returns true if a type is unranked tensor.
Source§

fn is_vector(&self) -> bool

Returns true if a type is vector.
Source§

impl<'c> Copy for MemRefType<'c>

Auto Trait Implementations§

§

impl<'c> Freeze for MemRefType<'c>

§

impl<'c> RefUnwindSafe for MemRefType<'c>

§

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

§

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

§

impl<'c> Unpin for MemRefType<'c>

§

impl<'c> UnwindSafe for MemRefType<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.