pub trait Shim {
// Required methods
fn name(&self) -> String;
fn supports(&self, class: ClassId) -> Support;
fn fits(&self, op: &Op, g: &TensorGraph) -> Result<(), String>;
fn numerics(&self) -> Option<Contract>;
// Provided methods
fn activation(
&self,
_consumer: &Op,
_operand: usize,
_g: &TensorGraph,
) -> Option<QuantFormat> { ... }
fn rules(&self) -> Vec<(Position, ChipRule<'_>)> { ... }
}Expand description
What a chip allows.
Required Methods§
Sourcefn name(&self) -> String
fn name(&self) -> String
The chip and the configuration it answers for, e.g. cuda-lane:rtx3060:TwoPassInt8.
Sourcefn supports(&self, class: ClassId) -> Support
fn supports(&self, class: ClassId) -> Support
What the chip’s link does with class. Every chip answers by a match over every class with no catch-all arm,
so a class added to the registry fails the build until each chip answers it.
Provided Methods§
Sourcefn activation(
&self,
_consumer: &Op,
_operand: usize,
_g: &TensorGraph,
) -> Option<QuantFormat>
fn activation( &self, _consumer: &Op, _operand: usize, _g: &TensorGraph, ) -> Option<QuantFormat>
The quantized form consumer reads its operand operand in, or None for one it reads as its values.