Trait CubePrimitive

Source
pub trait CubePrimitive:
    CubeType<ExpandType = ExpandElementTyped<Self>>
    + ExpandElementBaseInit
    + PartialEq
    + Send
    + Sync
    + 'static
    + Clone
    + Copy {
    // Provided methods
    fn as_elem(_context: &Scope) -> Elem { ... }
    fn as_elem_native() -> Option<Elem> { ... }
    fn as_elem_native_unchecked() -> Elem { ... }
    fn size() -> Option<usize> { ... }
    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 __expand_elem_size(context: &Scope) -> u32 { ... }
}
Expand description

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

Provided Methods§

Source

fn as_elem(_context: &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 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 __expand_elem_size(context: &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 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§