pub enum Type {
Scalar(StorageType),
Vector(StorageType, usize),
Semantic(SemanticType),
}Variants§
Scalar(StorageType)
Scalar type containing a single storage element
Vector(StorageType, usize)
Vector wrapping n storage elements
Semantic(SemanticType)
No defined physical representation, purely semantic. i.e. barrier, pipeline
Implementations§
Source§impl Type
impl Type
Sourcepub fn new(storage: StorageType) -> Type
pub fn new(storage: StorageType) -> Type
Create a new item
pub fn scalar(elem: ElemType) -> Type
pub fn semantic(ty: SemanticType) -> Type
pub fn with_vector_size(self, vector_size: usize) -> Type
pub fn with_storage_type(self, storage: StorageType) -> Type
pub fn vector_size(&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_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 is_semantic(&self) -> bool
pub fn constant(&self, value: ConstantValue) -> Variable
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Type, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Type, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SemanticType> for Type
impl From<SemanticType> for Type
Source§fn from(val: SemanticType) -> Type
fn from(val: SemanticType) -> Type
Converts to this type from the input type.
Source§impl Ord for Type
impl Ord for Type
Source§impl PartialOrd for Type
impl PartialOrd for Type
Source§impl Serialize for Type
impl Serialize for Type
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Type
impl Eq 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
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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
Source§impl<T> CompilationArg for T
impl<T> CompilationArg for T
Source§fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
Compilation args should be the same even with different element types. However, it isn’t
possible to enforce it with the type system. So, we make the compilation args serializable
and dynamically cast them. Read more
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.