AccelerateBackend

Trait AccelerateBackend 

Source
pub trait AccelerateBackend: Send + Sync {
    // Required methods
    fn device_info(&self) -> DeviceInfo;
    fn upload_matrix(&self, host: &Tensor) -> Result<Box<dyn DeviceMatrix>>;
    fn download_matrix(&self, dev: &dyn DeviceMatrix) -> Result<Tensor>;
    fn elem_add(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_sub(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_mul(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_ne(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_eq(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_div(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn elem_pow(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn matmul(
        &self,
        a: &dyn DeviceMatrix,
        b: &dyn DeviceMatrix,
    ) -> Result<Box<dyn DeviceMatrix>>;
    fn transpose(&self, a: &dyn DeviceMatrix) -> Result<Box<dyn DeviceMatrix>>;
}
Expand description

Core backend interface that concrete backends must implement.

Required Methods§

Source

fn device_info(&self) -> DeviceInfo

Source

fn upload_matrix(&self, host: &Tensor) -> Result<Box<dyn DeviceMatrix>>

Source

fn download_matrix(&self, dev: &dyn DeviceMatrix) -> Result<Tensor>

Source

fn elem_add( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_sub( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_mul( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_ne( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_eq( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_div( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn elem_pow( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn matmul( &self, a: &dyn DeviceMatrix, b: &dyn DeviceMatrix, ) -> Result<Box<dyn DeviceMatrix>>

Source

fn transpose(&self, a: &dyn DeviceMatrix) -> Result<Box<dyn DeviceMatrix>>

Implementors§