Trait CubePrimitive

Source
pub trait CubePrimitive:
    CubeType<ExpandType = ExpandElementTyped<Self>>
    + ExpandElementIntoMut
    + PartialEq
    + Send
    + Sync
    + 'static
    + Clone
    + Copy {
    // Provided methods
    fn as_elem(_scope: &Scope) -> Elem { ... }
    fn as_elem_native() -> Option<Elem> { ... }
    fn as_elem_native_unchecked() -> Elem { ... }
    fn size() -> Option<usize> { ... }
    fn size_bits() -> Option<usize> { ... }
    fn min_line_size(&self) -> Option<u8> { ... }
    fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType { ... }
    fn is_supported<S: ComputeServer<Feature = Feature>, C: ComputeChannel<S>>(
        client: &ComputeClient<S, C>,
    ) -> bool { ... }
    fn elem_size() -> u32 { ... }
    fn elem_size_bits() -> u32 { ... }
    fn __expand_elem_size(scope: &Scope) -> u32 { ... }
    fn __expand_elem_size_bits(scope: &Scope) -> u32 { ... }
}
Expand description

Form of CubeType that encapsulates all primitive types: Numeric, UInt, Bool

Provided Methods§

Source

fn as_elem(_scope: &Scope) -> Elem

Return the element type to use on GPU.

Source

fn as_elem_native() -> Option<Elem>

Native or static element type.

Source

fn as_elem_native_unchecked() -> Elem

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 min_line_size(&self) -> Option<u8>

Minimum line size of this type

Source

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

Source

fn is_supported<S: ComputeServer<Feature = Feature>, C: ComputeChannel<S>>( client: &ComputeClient<S, C>, ) -> bool

Source

fn elem_size() -> u32

Source

fn elem_size_bits() -> u32

Source

fn __expand_elem_size(scope: &Scope) -> u32

Source

fn __expand_elem_size_bits(scope: &Scope) -> u32

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_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for f64

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for i8

Source§

impl CubePrimitive for i16

Source§

impl CubePrimitive for i32

Source§

impl CubePrimitive for i64

Source§

impl CubePrimitive for u8

Source§

impl CubePrimitive for u16

Source§

impl CubePrimitive for u32

Source§

impl CubePrimitive for u64

Source§

impl CubePrimitive for e2m1

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for e2m3

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for e3m2

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for e4m3

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for e5m2

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for ue8m0

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for bf16

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Source§

impl CubePrimitive for f16

Source§

fn as_elem_native() -> Option<Elem>

Return the element type to use on GPU

Implementors§