pub enum Type {
Scalar(StorageType),
Opaque(OpaqueType),
Vector(Intern<Type>, VectorSize),
Semantic(SemanticType),
Atomic(Intern<Type>),
Pointer(Intern<Type>, AddressSpace),
Array(Intern<Type>, usize),
DynamicArray(Intern<Type>),
Matrix(MatrixType),
Aggregate(AggregateKind),
}Variants§
Scalar(StorageType)
Scalar type containing a single storage element
Opaque(OpaqueType)
Opaque types that can be stored but not interacted with normally. i.e. barrier, arrival tokens and tensor map descriptor.
Vector(Intern<Type>, VectorSize)
Vector wrapping n storage elements
Semantic(SemanticType)
No defined physical representation, purely semantic. i.e. barrier, pipeline
Atomic(Intern<Type>)
Atomically accessed version of Type
Pointer(Intern<Type>, AddressSpace)
Pointer of Type into a PointerClass
Array(Intern<Type>, usize)
Statically sized array of Types
DynamicArray(Intern<Type>)
Dynamically sized array of Types
Matrix(MatrixType)
Cooperative Matrix
Aggregate(AggregateKind)
Implementations§
Source§impl Type
impl Type
pub fn intern(self) -> Intern<Type>
Sourcepub fn new(storage: StorageType) -> Self
pub fn new(storage: StorageType) -> Self
Create a new item
pub fn scalar(elem: ElemType) -> Self
pub fn semantic(ty: SemanticType) -> Self
pub fn atomic(ty: impl Into<Type>) -> Self
pub fn with_vector_size(self, vector_size: VectorSize) -> Self
pub fn pointer(ty: impl Into<Type>, class: AddressSpace) -> Self
pub fn array(ty: impl Into<Type>, size: usize) -> Self
pub fn vector_size(&self) -> VectorSize
pub fn array_size(&self) -> usize
pub fn align(&self) -> usize
pub fn size(&self) -> usize
pub fn size_bits(&self) -> usize
pub fn packing_factor(&self) -> usize
pub fn is_atomic(&self) -> bool
pub fn is_ptr(&self) -> bool
pub fn is_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn storage_type(&self) -> StorageType
pub fn as_scalar(&self) -> Self
Sourcepub fn scalar_value_type(&self) -> Self
pub fn scalar_value_type(&self) -> Self
Utility mainly for use in cubecl-cpu
pub fn is_semantic(&self) -> bool
pub fn constant(&self, value: ConstantValue) -> Value
pub fn unwrap_ptr(&self) -> Type
pub fn address_space(&self) -> Option<AddressSpace>
pub fn value_type(&self) -> Type
pub fn is_array_like(&self) -> bool
Sourcepub fn is_destructurable(&self) -> bool
pub fn is_destructurable(&self) -> bool
Whether a type is destructurable. This implies that
- it does not have dynamic field offsets (i.e.
Array) - it can exist in registers (i.e. no
BarrierorAtomic)
pub fn is_value(&self) -> bool
Trait Implementations§
impl Copy for Type
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Type
Source§impl From<OpaqueType> for Type
impl From<OpaqueType> for Type
Source§fn from(val: OpaqueType) -> Self
fn from(val: OpaqueType) -> Self
Converts to this type from the input type.
Source§impl From<SemanticType> for Type
impl From<SemanticType> for Type
Source§fn from(val: SemanticType) -> Self
fn from(val: SemanticType) -> Self
Converts to this type from the input type.
Source§impl Hash for Type
Intern hashes the pointer, not the values, leading to unstable hashes across runs.
Fix this by manually hashing the value.
impl Hash for Type
Intern hashes the pointer, not the values, leading to unstable hashes across runs.
Fix this by manually hashing the value.
Source§impl Ord for Type
impl Ord for Type
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Type
impl PartialOrd for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more