pub trait CubePrimitive:
CubeType<ExpandType = ExpandElementTyped<Self>>
+ ExpandElementIntoMut
+ PartialEq
+ Send
+ Sync
+ 'static
+ Clone
+ Copy {
Show 16 methods
// Required method
fn from_const_value(value: ConstantValue) -> Self;
// Provided methods
fn as_type(_scope: &Scope) -> StorageType { ... }
fn as_type_native() -> Option<StorageType> { ... }
fn as_type_native_unchecked() -> StorageType { ... }
fn size() -> Option<usize> { ... }
fn size_bits() -> Option<usize> { ... }
fn size_bits_unchecked() -> usize { ... }
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType { ... }
fn into_lit_unchecked(self) -> Self { ... }
fn supported_uses<R: Runtime>(
client: &ComputeClient<R>,
) -> EnumSet<TypeUsage> { ... }
fn type_size() -> usize { ... }
fn type_size_bits() -> usize { ... }
fn packing_factor() -> usize { ... }
fn __expand_type_size(scope: &Scope) -> usize { ... }
fn __expand_type_size_bits(scope: &Scope) -> usize { ... }
fn __expand_packing_factor(scope: &Scope) -> usize { ... }
}Expand description
Form of CubeType that encapsulates all primitive types: Numeric, UInt, Bool
Required Methods§
fn from_const_value(value: ConstantValue) -> Self
Provided Methods§
Sourcefn as_type(_scope: &Scope) -> StorageType
fn as_type(_scope: &Scope) -> StorageType
Return the element type to use on GPU.
Sourcefn as_type_native() -> Option<StorageType>
fn as_type_native() -> Option<StorageType>
Native or static element type.
Sourcefn as_type_native_unchecked() -> StorageType
fn as_type_native_unchecked() -> StorageType
Native or static element type.
Sourcefn size_bits_unchecked() -> usize
fn size_bits_unchecked() -> usize
Only native element types have a size.
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType
fn into_lit_unchecked(self) -> Self
fn supported_uses<R: Runtime>(client: &ComputeClient<R>) -> EnumSet<TypeUsage>
fn type_size() -> usize
fn type_size_bits() -> usize
fn packing_factor() -> usize
fn __expand_type_size(scope: &Scope) -> usize
fn __expand_type_size_bits(scope: &Scope) -> usize
fn __expand_packing_factor(scope: &Scope) -> usize
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl CubePrimitive for bool
impl CubePrimitive for bool
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for f32
impl CubePrimitive for f32
Source§fn as_type_native() -> Option<StorageType>
fn as_type_native() -> Option<StorageType>
Return the element type to use on GPU
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for f64
impl CubePrimitive for f64
Source§fn as_type_native() -> Option<StorageType>
fn as_type_native() -> Option<StorageType>
Return the element type to use on GPU
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for i8
impl CubePrimitive for i8
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for i16
impl CubePrimitive for i16
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for i32
impl CubePrimitive for i32
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for i64
impl CubePrimitive for i64
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for isize
impl CubePrimitive for isize
fn from_const_value(value: ConstantValue) -> Self
fn as_type(scope: &Scope) -> StorageType
Source§impl CubePrimitive for u8
impl CubePrimitive for u8
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for u16
impl CubePrimitive for u16
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for u32
impl CubePrimitive for u32
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for u64
impl CubePrimitive for u64
fn as_type_native() -> Option<StorageType>
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for usize
impl CubePrimitive for usize
fn from_const_value(value: ConstantValue) -> Self
fn as_type(scope: &Scope) -> StorageType
Source§impl CubePrimitive for bf16
impl CubePrimitive for bf16
Source§fn as_type_native() -> Option<StorageType>
fn as_type_native() -> Option<StorageType>
Return the element type to use on GPU
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for f16
impl CubePrimitive for f16
Source§fn as_type_native() -> Option<StorageType>
fn as_type_native() -> Option<StorageType>
Return the element type to use on GPU