Struct CompiledBackend

Source
pub struct CompiledBackend<C: Compiler> { /* private fields */ }
Expand description

Compiled backend that holds compiler, buffers and programs

Implementations§

Source§

impl<C: Compiler> CompiledBackend<C>

Source

pub fn new(compiler: C) -> Self

Initialize new compiled backend using provided compiler

Trait Implementations§

Source§

impl<C: Compiler> RuntimeBackend for CompiledBackend<C>

Source§

fn is_evaluated(&self, x: Id) -> bool

Is tensor x evaluated?
Source§

fn is_free_id(&self, x: Id) -> bool

Check if there are no more buffers on id x
Source§

fn remove(&mut self, x: Id) -> Result<(), ZyxError>

Delete all memory used by tensor x.
Source§

fn store<T: Scalar, IT>(&mut self, x: Id, iter: IT) -> Result<(), ZyxError>
where IT: IntoIterator<Item = T>, IT::IntoIter: ExactSizeIterator,

Store iterator into runtime backend
Source§

fn load<T: Scalar>(&mut self, x: Id, numel: usize) -> Result<Vec<T>, ZyxError>

Load evaluated tensor x.
Source§

fn evaluate( &mut self, rcs: BTreeMap<Id, u32>, order: &[Id], nodes: &[Node], ) -> Result<(), ZyxError>

Evaluate tensors to_eval with given graph of nodes and recommended order of evaluation.

Auto Trait Implementations§

§

impl<C> Freeze for CompiledBackend<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for CompiledBackend<C>

§

impl<C> Send for CompiledBackend<C>
where C: Send, <C as Compiler>::Buffer: Send, <C as Compiler>::Program: Send,

§

impl<C> Sync for CompiledBackend<C>
where C: Sync, <C as Compiler>::Buffer: Sync, <C as Compiler>::Program: Sync,

§

impl<C> Unpin for CompiledBackend<C>
where C: Unpin,

§

impl<C> UnwindSafe for CompiledBackend<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.