pub trait NeuralAccelerator {
type Error;
// Required methods
fn is_available(&self) -> bool;
fn name(&self) -> &'static str;
fn upload_neurons(&mut self, neurons: &[u8]) -> Result<(), Self::Error>;
fn upload_synapses(&mut self, synapses: &[u8]) -> Result<(), Self::Error>;
fn process_burst(&mut self) -> Result<u32, Self::Error>;
fn download_neurons(
&mut self,
buffer: &mut [u8],
) -> Result<usize, Self::Error>;
// Provided methods
fn performance_ops_per_sec(&self) -> u64 { ... }
fn reset(&mut self) -> Result<(), Self::Error> { ... }
}Expand description
Neural accelerator abstraction for hardware acceleration (Hailo, TPU, etc.)
Required Associated Types§
Required Methods§
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Sourcefn process_burst(&mut self) -> Result<u32, Self::Error>
fn process_burst(&mut self) -> Result<u32, Self::Error>
Provided Methods§
Sourcefn performance_ops_per_sec(&self) -> u64
fn performance_ops_per_sec(&self) -> u64
Get accelerator performance metrics (TOPS, GOPS, etc.)
§Returns
Performance in operations per second