pub enum Type {
U32,
I32,
F32,
F16,
F64,
Bool,
Ptr(AddressSpace),
Array(Box<Type>, usize),
Void,
}Expand description
GPU-specific type system where all types map to WAVE registers.
Variants§
U32
Unsigned 32-bit integer.
I32
Signed 32-bit integer.
F32
32-bit floating point.
F16
16-bit floating point (stored in lower half of 32-bit register).
F64
64-bit floating point (register pair).
Bool
Boolean predicate (maps to WAVE predicate register).
Ptr(AddressSpace)
Pointer to memory in a specific address space.
Array(Box<Type>, usize)
Fixed-size array of a given element type.
Void
No return value.
Implementations§
Source§impl Type
impl Type
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Returns the size in bytes of this type.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is an integer type.
Sourcepub fn is_pointer(&self) -> bool
pub fn is_pointer(&self) -> bool
Returns true if this is a pointer type.
Sourcepub fn register_count(&self) -> usize
pub fn register_count(&self) -> usize
Returns the number of 32-bit registers needed to hold this type.
Trait Implementations§
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