pub trait CubePrimitive:
CubeType<ExpandType = NativeExpand<Self>>
+ NativeAssign
+ CanReadValue
+ CubeDebug
+ Send
+ Sync
+ 'static
+ Clone
+ Copy {
type Scalar: Scalar;
type Size: Size;
type WithScalar<S: Scalar>: CubePrimitive;
Show 13 methods
// Required methods
fn from_const_value(value: ConstantValue) -> Self;
fn __expand_as_type(scope: &Scope) -> TypeHandle;
// Provided methods
fn as_type() -> TypeHandle { ... }
fn size() -> usize { ... }
fn size_bits() -> usize { ... }
fn from_expand_elem(elem: ExpandValue) -> Self::ExpandType { ... }
fn into_lit_unchecked(self) -> Self { ... }
fn packing_factor() -> usize { ... }
fn vector_size() -> usize { ... }
fn __expand_size(scope: &Scope) -> usize { ... }
fn __expand_size_bits(scope: &Scope) -> usize { ... }
fn __expand_packing_factor(scope: &Scope) -> usize { ... }
fn __expand_vector_size(scope: &Scope) -> usize { ... }
}Expand description
Form of CubeType that encapsulates all primitive types:
Numeric, UInt, Bool
Required Associated Types§
Required Methods§
fn from_const_value(value: ConstantValue) -> Self
fn __expand_as_type(scope: &Scope) -> TypeHandle
Provided Methods§
Sourcefn as_type() -> TypeHandle
fn as_type() -> TypeHandle
Return the element type to use on GPU.
fn from_expand_elem(elem: ExpandValue) -> Self::ExpandType
fn into_lit_unchecked(self) -> Self
fn packing_factor() -> usize
fn vector_size() -> usize
fn __expand_size(scope: &Scope) -> usize
fn __expand_size_bits(scope: &Scope) -> usize
fn __expand_packing_factor(scope: &Scope) -> usize
fn __expand_vector_size(scope: &Scope) -> usize
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl CubePrimitive for Complex<f32>
impl CubePrimitive for Complex<f32>
type Scalar = Complex<f32>
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
fn __expand_as_type(scope: &Scope) -> TypeHandle
Source§impl CubePrimitive for Complex<f64>
impl CubePrimitive for Complex<f64>
type Scalar = Complex<f64>
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
fn __expand_as_type(scope: &Scope) -> TypeHandle
Source§impl CubePrimitive for bf16
impl CubePrimitive for bf16
Source§fn __expand_as_type(scope: &Scope) -> TypeHandle
fn __expand_as_type(scope: &Scope) -> TypeHandle
Return the element type to use on GPU
type Scalar = bf16
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for bool
impl CubePrimitive for bool
type Scalar = bool
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
fn __expand_as_type(scope: &Scope) -> TypeHandle
Source§impl CubePrimitive for f16
impl CubePrimitive for f16
Source§fn __expand_as_type(scope: &Scope) -> TypeHandle
fn __expand_as_type(scope: &Scope) -> TypeHandle
Return the element type to use on GPU
type Scalar = f16
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for f32
impl CubePrimitive for f32
Source§fn __expand_as_type(scope: &Scope) -> TypeHandle
fn __expand_as_type(scope: &Scope) -> TypeHandle
Return the element type to use on GPU
type Scalar = f32
type Size = Const<1>
type WithScalar<S: Scalar> = S
fn from_const_value(value: ConstantValue) -> Self
Source§impl CubePrimitive for f64
impl CubePrimitive for f64
Source§fn __expand_as_type(scope: &Scope) -> TypeHandle
fn __expand_as_type(scope: &Scope) -> TypeHandle
Return the element type to use on GPU