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>
impl<Backends, Bridge> Clone for DirectChannel<Backends, Bridge>
Source§impl<B1: BackendIr, B2: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2), Br>
impl<B1: BackendIr, B2: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2), Br>
Source§type Device = <Br as MultiBackendBridge>::Device
type Device = <Br as MultiBackendBridge>::Device
Device type.
Source§type Client = MultiRunnerClient<B1, B2>
type Client = MultiRunnerClient<B1, B2>
Client type.
Source§fn init_client(device: &Self::Device) -> Self::Client
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
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>
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 change_client_backend(
tensor: RouterTensor<Self::Client>,
device: &Self::Device,
) -> RouterTensor<Self::Client>
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>
impl<B1: BackendIr, B2: BackendIr, B3: BackendIr, Br> RunnerChannel for DirectChannel<(B1, B2, B3), Br>
Source§type Device = <Br as MultiBackendBridge>::Device
type Device = <Br as MultiBackendBridge>::Device
Device type.
Source§type Client = MultiRunnerClient<B1, B2, B3>
type Client = MultiRunnerClient<B1, B2, B3>
Client type.
Source§fn init_client(device: &Self::Device) -> Self::Client
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
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>
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 change_client_backend(
tensor: RouterTensor<Self::Client>,
device: &Self::Device,
) -> RouterTensor<Self::Client>
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>>,
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
type Device = <Br as MultiBackendBridge>::Device
Device type.
Source§type Client = MultiRunnerClient<B1, B2, B3, B4>
type Client = MultiRunnerClient<B1, B2, B3, B4>
Client type.
Source§fn init_client(device: &Self::Device) -> Self::Client
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
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>
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 change_client_backend(
tensor: RouterTensor<Self::Client>,
device: &Self::Device,
) -> RouterTensor<Self::Client>
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>
impl<Backends, Bridge> Sync for DirectChannel<Backends, Bridge>
impl<Backends, Bridge> Unpin for DirectChannel<Backends, Bridge>
impl<Backends, Bridge> UnwindSafe for DirectChannel<Backends, Bridge>where
Backends: UnwindSafe,
Bridge: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more