Struct DirectChannel

Source
pub struct DirectChannel<Backends, Bridge> { /* private fields */ }
Expand description

A local channel with direct connection to the backend runner clients.

Trait Implementations§

Source§

impl<Backends, Bridge> Clone for DirectChannel<Backends, Bridge>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B1: BackendIr, B2: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2), Br>
where Br: MultiBackendBridge<TensorHandle = Handle<B1, B2>, Device = MultiDevice<B1, B2>>,

Source§

type Device = <Br as MultiBackendBridge>::Device

Device type.
Source§

type Bridge = Br

A bridge that can transfer tensors between multiple backends.
Source§

type FloatElem = <B1 as Backend>::FloatElem

Float element type.
Source§

type IntElem = <B1 as Backend>::IntElem

Int element type.
Source§

type BoolElem = <B1 as Backend>::BoolElem

Bool element type.
Source§

type Client = MultiRunnerClient<B1, B2>

Client type.
Source§

fn init_client(device: &Self::Device) -> Self::Client

Initialize a new client for the given device.
Source§

fn get_tensor_handle( tensor: &TensorIr, client: &Self::Client, ) -> <Self::Bridge as MultiBackendBridge>::TensorHandle

Get the tensor handle corresponding to the tensor representation.
Source§

fn register_tensor( client: &Self::Client, handle: <Self::Bridge as MultiBackendBridge>::TensorHandle, shape: Vec<usize>, dtype: DType, ) -> RouterTensor<Self::Client>

Create a tensor with the given handle and shape.
Source§

fn name(_device: &Self::Device) -> String

Name of the channel.
Source§

fn change_client_backend( tensor: RouterTensor<Self::Client>, device: &Self::Device, ) -> RouterTensor<Self::Client>

Change the tensor to a different client backend.
Source§

impl<B1: BackendIr, B2: BackendIr, B3: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2, B3), Br>
where Br: MultiBackendBridge<TensorHandle = Handle<B1, B2, B3>, Device = MultiDevice<B1, B2, B3>>,

Source§

type Device = <Br as MultiBackendBridge>::Device

Device type.
Source§

type Bridge = Br

A bridge that can transfer tensors between multiple backends.
Source§

type FloatElem = <B1 as Backend>::FloatElem

Float element type.
Source§

type IntElem = <B1 as Backend>::IntElem

Int element type.
Source§

type BoolElem = <B1 as Backend>::BoolElem

Bool element type.
Source§

type Client = MultiRunnerClient<B1, B2, B3>

Client type.
Source§

fn init_client(device: &Self::Device) -> Self::Client

Initialize a new client for the given device.
Source§

fn get_tensor_handle( tensor: &TensorIr, client: &Self::Client, ) -> <Self::Bridge as MultiBackendBridge>::TensorHandle

Get the tensor handle corresponding to the tensor representation.
Source§

fn register_tensor( client: &Self::Client, handle: <Self::Bridge as MultiBackendBridge>::TensorHandle, shape: Vec<usize>, dtype: DType, ) -> RouterTensor<Self::Client>

Create a tensor with the given handle and shape.
Source§

fn name(_device: &Self::Device) -> String

Name of the channel.
Source§

fn change_client_backend( tensor: RouterTensor<Self::Client>, device: &Self::Device, ) -> RouterTensor<Self::Client>

Change the tensor to a different client backend.
Source§

impl<B1: BackendIr, B2: BackendIr, B3: BackendIr, B4: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2, B3, B4), Br>
where Br: MultiBackendBridge<TensorHandle = Handle<B1, B2, B3, B4>, Device = MultiDevice<B1, B2, B3, B4>>,

Source§

type Device = <Br as MultiBackendBridge>::Device

Device type.
Source§

type Bridge = Br

A bridge that can transfer tensors between multiple backends.
Source§

type FloatElem = <B1 as Backend>::FloatElem

Float element type.
Source§

type IntElem = <B1 as Backend>::IntElem

Int element type.
Source§

type BoolElem = <B1 as Backend>::BoolElem

Bool element type.
Source§

type Client = MultiRunnerClient<B1, B2, B3, B4>

Client type.
Source§

fn init_client(device: &Self::Device) -> Self::Client

Initialize a new client for the given device.
Source§

fn get_tensor_handle( tensor: &TensorIr, client: &Self::Client, ) -> <Self::Bridge as MultiBackendBridge>::TensorHandle

Get the tensor handle corresponding to the tensor representation.
Source§

fn register_tensor( client: &Self::Client, handle: <Self::Bridge as MultiBackendBridge>::TensorHandle, shape: Vec<usize>, dtype: DType, ) -> RouterTensor<Self::Client>

Create a tensor with the given handle and shape.
Source§

fn name(_device: &Self::Device) -> String

Name of the channel.
Source§

fn change_client_backend( tensor: RouterTensor<Self::Client>, device: &Self::Device, ) -> RouterTensor<Self::Client>

Change the tensor to a different client backend.

Auto Trait Implementations§

§

impl<Backends, Bridge> Freeze for DirectChannel<Backends, Bridge>

§

impl<Backends, Bridge> RefUnwindSafe for DirectChannel<Backends, Bridge>
where Backends: RefUnwindSafe, Bridge: RefUnwindSafe,

§

impl<Backends, Bridge> Send for DirectChannel<Backends, Bridge>
where Backends: Send, Bridge: Send,

§

impl<Backends, Bridge> Sync for DirectChannel<Backends, Bridge>
where Backends: Sync, Bridge: Sync,

§

impl<Backends, Bridge> Unpin for DirectChannel<Backends, Bridge>
where Backends: Unpin, Bridge: Unpin,

§

impl<Backends, Bridge> UnwindSafe for DirectChannel<Backends, Bridge>
where Backends: UnwindSafe, Bridge: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V