Skip to main content

SubmissionBackend

Trait SubmissionBackend 

Source
pub trait SubmissionBackend: NeuralBackend {
    type Executor: ?Sized;
    type OwnedExecutor: Borrow<Self::Executor>;
    type Completion: Completion;

    // Required methods
    fn fork_executors(
        executor: &Self::Executor,
        count: usize,
    ) -> Result<Vec<Self::OwnedExecutor>, <Self::Completion as Completion>::Error>;
    fn submit<'a, I>(
        executor: &Self::Executor,
        values: I,
    ) -> Result<Self::Completion, <Self::Completion as Completion>::Error>
       where Self::Tensor: 'a,
             I: IntoIterator<Item = &'a Self::Tensor>;
    fn order_after(
        completion: &Self::Completion,
        executor: &Self::Executor,
    ) -> Result<(), <Self::Completion as Completion>::Error>;
    fn retain_until_complete<T: Send + 'static>(
        executor: &Self::Executor,
        completion: &Self::Completion,
        value: T,
    ) -> Result<(), <Self::Completion as Completion>::Error>;
}
Expand description

Submits backend-native work and retains values through exact completion.

Required Associated Types§

Source

type Executor: ?Sized

Backend executor, queue, stream, or equivalent submission context.

Source

type OwnedExecutor: Borrow<Self::Executor>

Owned executor used for an independently schedulable graph lane.

Source

type Completion: Completion

Exact completion object for one submission.

Required Methods§

Source

fn fork_executors( executor: &Self::Executor, count: usize, ) -> Result<Vec<Self::OwnedExecutor>, <Self::Completion as Completion>::Error>

Creates independently schedulable executors on the same backend device.

Source

fn submit<'a, I>( executor: &Self::Executor, values: I, ) -> Result<Self::Completion, <Self::Completion as Completion>::Error>
where Self::Tensor: 'a, I: IntoIterator<Item = &'a Self::Tensor>,

Submits evaluation of backend-native values on one executor.

Source

fn order_after( completion: &Self::Completion, executor: &Self::Executor, ) -> Result<(), <Self::Completion as Completion>::Error>

Orders future work on executor after an exact producer completion.

Source

fn retain_until_complete<T: Send + 'static>( executor: &Self::Executor, completion: &Self::Completion, value: T, ) -> Result<(), <Self::Completion as Completion>::Error>

Retains an owned value until completion has completed exactly.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§