Skip to main content

GemmScalar

Trait GemmScalar 

Source
pub trait GemmScalar: Scalar {
    const OUT_IS_ACC: bool;
}
Expand description

The dispatch layer runs f32 and f64 directly, as a homogeneous float. Under half, it also runs f16 and bf16 as mixed precision, with Acc = f32

The bound is Scalar, not Float<Acc = Self>, so the accumulator type may differ from the element type (the mixed-precision seam). The methods below supply what a generic bound alone cannot express: the degenerate beta-only scale, and which kernel family packs and dispatches the value. This keeps the driver and the public API type-agnostic

Required Associated Constants§

Source

const OUT_IS_ACC: bool

Mirrors crate::kernel::KernelFamily::OUT_IS_ACC for this type: true for f32/f64, false for f16/bf16. The prepack constructor reads it so a prepacked buffer blocks with the same kc the consuming kernel will use

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 GemmScalar for bf16

Available on crate feature half only.
Source§

const OUT_IS_ACC: bool = false

Source§

impl GemmScalar for f16

Available on crate feature half only.
Source§

const OUT_IS_ACC: bool = false

Source§

impl GemmScalar for f32

Source§

const OUT_IS_ACC: bool = true

Source§

impl GemmScalar for f64

Source§

const OUT_IS_ACC: bool = true

Implementors§