Skip to main content

HostDtype

Trait HostDtype 

Source
pub trait HostDtype:
    Copy
    + Send
    + Sync
    + 'static {
    const DTYPE: Dtype;
}
Expand description

Marker trait connecting a host element type T to its runtime Dtype tag. Used by the typed Backend allocator + uploader so the trait surface has ONE alloc_typed(Dtype, n) / from_slice_typed<T>(&[T]) / write_typed<T>(buf, &[T]) instead of the per-dtype-named family (alloc_u32, from_slice_i32, write_i32_into, write_f32_into, …).

Implemented for all dtypes that backends store in Self::Buffer.

Required Associated Constants§

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 HostDtype for f16

Source§

const DTYPE: Dtype = Dtype::F16

Source§

impl HostDtype for f32

Source§

const DTYPE: Dtype = Dtype::F32

Source§

impl HostDtype for i8

Source§

const DTYPE: Dtype = Dtype::I8

Source§

impl HostDtype for i32

Source§

const DTYPE: Dtype = Dtype::I32

Source§

impl HostDtype for u32

Source§

const DTYPE: Dtype = Dtype::U32

Implementors§