Skip to main content

CubePrimitive

Trait CubePrimitive 

Source
pub trait CubePrimitive:
    CubeType<ExpandType = NativeExpand<Self>>
    + NativeAssign
    + PartialEq
    + Send
    + Sync
    + 'static
    + Clone
    + Copy {
    type Scalar: Scalar;
    type Size: Size;
    type WithScalar<S: Scalar>: CubePrimitive;

Show 18 methods // Required method fn from_const_value(value: ConstantValue) -> Self; // Provided methods fn as_type(_scope: &Scope) -> Type { ... } fn as_type_native() -> Option<Type> { ... } fn as_type_native_unchecked() -> Type { ... } fn size() -> Option<usize> { ... } fn size_bits() -> Option<usize> { ... } fn size_bits_unchecked() -> usize { ... } fn from_expand_elem(elem: ManagedVariable) -> 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 vector_size() -> usize { ... } fn __expand_type_size(scope: &Scope) -> usize { ... } fn __expand_type_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§

Provided Methods§

Source

fn as_type(_scope: &Scope) -> Type

Return the element type to use on GPU.

Source

fn as_type_native() -> Option<Type>

Native or static element type.

Source

fn as_type_native_unchecked() -> Type

Native or static element type.

Source

fn size() -> Option<usize>

Only native element types have a size.

Source

fn size_bits() -> Option<usize>

Only native element types have a size.

Source

fn size_bits_unchecked() -> usize

Only native element types have a size.

Source

fn from_expand_elem(elem: ManagedVariable) -> Self::ExpandType

Source

fn into_lit_unchecked(self) -> Self

Source

fn supported_uses<R: Runtime>(client: &ComputeClient<R>) -> EnumSet<TypeUsage>

Source

fn type_size() -> usize

Source

fn type_size_bits() -> usize

Source

fn packing_factor() -> usize

Source

fn vector_size() -> usize

Source

fn __expand_type_size(scope: &Scope) -> usize

Source

fn __expand_type_size_bits(scope: &Scope) -> usize

Source

fn __expand_packing_factor(scope: &Scope) -> usize

Source

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CubePrimitive for bool

Source§

impl CubePrimitive for f32

Source§

fn as_type_native() -> Option<Type>

Return the element type to use on GPU

Source§

type Scalar = f32

Source§

type Size = Const<1>

Source§

type WithScalar<S: Scalar> = S

Source§

fn from_const_value(value: ConstantValue) -> Self

Source§

impl CubePrimitive for f64

Source§

fn as_type_native() -> Option<Type>

Return the element type to use on GPU

Source§

type Scalar = f64

Source§

type Size = Const<1>

Source§

type WithScalar<S: Scalar> = S

Source§

fn from_const_value(value: ConstantValue) -> Self

Source§

impl CubePrimitive for i8

Source§

impl CubePrimitive for i16

Source§

impl CubePrimitive for i32

Source§

impl CubePrimitive for i64

Source§

impl CubePrimitive for isize

Source§

impl CubePrimitive for u8

Source§

impl CubePrimitive for u16

Source§

impl CubePrimitive for u32

Source§

impl CubePrimitive for u64

Source§

impl CubePrimitive for usize

Source§

impl CubePrimitive for bf16

Source§

fn as_type_native() -> Option<Type>

Return the element type to use on GPU

Source§

type Scalar = bf16

Source§

type Size = Const<1>

Source§

type WithScalar<S: Scalar> = S

Source§

fn from_const_value(value: ConstantValue) -> Self

Source§

impl CubePrimitive for f16

Source§

fn as_type_native() -> Option<Type>

Return the element type to use on GPU

Source§

type Scalar = f16

Source§

type Size = Const<1>

Source§

type WithScalar<S: Scalar> = S

Source§

fn from_const_value(value: ConstantValue) -> Self

Implementors§

Source§

impl CubePrimitive for e2m1

Source§

impl CubePrimitive for e2m1x2

Source§

impl CubePrimitive for e2m3

Source§

impl CubePrimitive for e3m2

Source§

impl CubePrimitive for e4m3

Source§

impl CubePrimitive for e5m2

Source§

impl CubePrimitive for flex32

Source§

impl CubePrimitive for tf32

Source§

impl CubePrimitive for ue8m0

Source§

impl CubePrimitive for Barrier

Source§

impl<Inner: CubePrimitive> CubePrimitive for Atomic<Inner>

Source§

impl<Marker: 'static> CubePrimitive for DynamicScalar<Marker>

Source§

impl<P: Scalar, N: Size> CubePrimitive for Vector<P, N>