Skip to main content

AccelDtype

Trait AccelDtype 

Source
pub trait AccelDtype:
    Copy
    + Send
    + Sync
    + 'static
    + Debug {
    type Scalar: Copy + Send + Sync + 'static + Debug;

    const KIND: DType;
    const SIZE: usize;
    const NAME: &'static str;

    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
    fn nan() -> Option<Self>;
}
Expand description

Marker for any numeric type that can be a typed device buffer element across atomr-accel backends.

AccelDtype is intentionally narrower than what individual backends can support. cuBLAS f64 GEMM is gated by a GemmSupported marker on the CUDA side; this trait says only that the type is a recognised dtype.

Required Associated Constants§

Source

const KIND: DType

Runtime discriminant.

Source

const SIZE: usize

Bytes per element including representation padding.

Source

const NAME: &'static str

Human-readable name used in tracing and error messages.

Required Associated Types§

Source

type Scalar: Copy + Send + Sync + 'static + Debug

Companion scalar type for host-side parameters (alpha/beta, mean/std, scaling factors). Self for full-precision dtypes; f32 for fp8 / fp4 wrappers because the upstream APIs accept f32 scales.

Required Methods§

Source

fn zero() -> Self

Source

fn one() -> Self

Source

fn nan() -> Option<Self>

Some(NaN) for floats, None for integers.

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 AccelDtype for f32

Source§

const KIND: DType = DType::F32

Source§

const SIZE: usize

Source§

const NAME: &'static str = "f32"

Source§

type Scalar = f32

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for f64

Source§

const KIND: DType = DType::F64

Source§

const SIZE: usize

Source§

const NAME: &'static str = "f64"

Source§

type Scalar = f64

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for i8

Source§

const KIND: DType = DType::I8

Source§

const SIZE: usize

Source§

const NAME: &'static str = "i8"

Source§

type Scalar = i8

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for i16

Source§

const KIND: DType = DType::I16

Source§

const SIZE: usize

Source§

const NAME: &'static str = "i16"

Source§

type Scalar = i16

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for i32

Source§

const KIND: DType = DType::I32

Source§

const SIZE: usize

Source§

const NAME: &'static str = "i32"

Source§

type Scalar = i32

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for i64

Source§

const KIND: DType = DType::I64

Source§

const SIZE: usize

Source§

const NAME: &'static str = "i64"

Source§

type Scalar = i64

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for u8

Source§

const KIND: DType = DType::U8

Source§

const SIZE: usize

Source§

const NAME: &'static str = "u8"

Source§

type Scalar = u8

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for u16

Source§

const KIND: DType = DType::U16

Source§

const SIZE: usize

Source§

const NAME: &'static str = "u16"

Source§

type Scalar = u16

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for u32

Source§

const KIND: DType = DType::U32

Source§

const SIZE: usize

Source§

const NAME: &'static str = "u32"

Source§

type Scalar = u32

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Source§

impl AccelDtype for u64

Source§

const KIND: DType = DType::U64

Source§

const SIZE: usize

Source§

const NAME: &'static str = "u64"

Source§

type Scalar = u64

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn nan() -> Option<Self>

Implementors§