pub struct MutexFusionClient<R: FusionRuntime> { /* private fields */ }
Expand description
Use a mutex to communicate with the fusion server.
Trait Implementations§
Source§impl<R> Clone for MutexFusionClient<R>where
R: FusionRuntime,
impl<R> Clone for MutexFusionClient<R>where
R: FusionRuntime,
Source§impl<R> FusionClient<R> for MutexFusionClient<R>where
R: FusionRuntime<FusionClient = Self> + 'static,
impl<R> FusionClient<R> for MutexFusionClient<R>where
R: FusionRuntime<FusionClient = Self> + 'static,
Source§fn new(device: FusionDevice<R>) -> Self
fn new(device: FusionDevice<R>) -> Self
Create a new client for the given device.
Source§fn register<O>(
&self,
streams: OperationStreams,
repr: OperationIr,
operation: O,
)where
O: Operation<R> + 'static,
fn register<O>(
&self,
streams: OperationStreams,
repr: OperationIr,
operation: O,
)where
O: Operation<R> + 'static,
Register a new tensor operation intermediate representation.
Source§fn tensor_uninitialized(
&self,
shape: Vec<usize>,
dtype: DType,
) -> FusionTensor<R>
fn tensor_uninitialized( &self, shape: Vec<usize>, dtype: DType, ) -> FusionTensor<R>
Create a new fusion tensor, but with no resources allocated to it.
Source§fn device(&self) -> &FusionDevice<R>
fn device(&self) -> &FusionDevice<R>
Get the current device used by all operations handled by this client.
Source§fn register_tensor(
&self,
handle: FusionHandle<R>,
shape: Vec<usize>,
stream: StreamId,
dtype: DType,
) -> FusionTensor<R>
fn register_tensor( &self, handle: FusionHandle<R>, shape: Vec<usize>, stream: StreamId, dtype: DType, ) -> FusionTensor<R>
Create a tensor with the given handle and shape.
Source§fn read_tensor_float<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_float<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by a float tensor.
Source§fn read_tensor_int<B>(
self,
tensor: TensorIr,
id: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_int<B>(
self,
tensor: TensorIr,
id: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by an int tensor.
Source§fn read_tensor_bool<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_bool<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by a bool tensor.
Source§fn read_tensor_quantized<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_quantized<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by a quantized tensor.
Source§fn change_client_float<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
fn change_client_float<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
Change the client of the given float tensor.
Source§fn change_client_int<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
fn change_client_int<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
Change the client of the given int tensor.
Source§fn change_client_bool<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
fn change_client_bool<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
Change the client of the given bool tensor.
Source§fn change_client_quantized<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
fn change_client_quantized<B>(
&self,
tensor: TensorIr,
client: Self,
stream: StreamId,
) -> FusionTensor<R>where
B: FusionBackend<FusionRuntime = R>,
Change the client of the given quantized tensor.
Source§fn resolve_tensor_float<B>(
&self,
tensor: FusionTensor<R>,
) -> B::FloatTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
fn resolve_tensor_float<B>(
&self,
tensor: FusionTensor<R>,
) -> B::FloatTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
Resolve the given float tensor to a primitive tensor.
Source§fn resolve_tensor_int<B>(
&self,
tensor: FusionTensor<R>,
) -> B::IntTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
fn resolve_tensor_int<B>(
&self,
tensor: FusionTensor<R>,
) -> B::IntTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
Resolve the given int tensor to a primitive tensor.
Source§fn resolve_tensor_bool<B>(
&self,
tensor: FusionTensor<R>,
) -> B::BoolTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
fn resolve_tensor_bool<B>(
&self,
tensor: FusionTensor<R>,
) -> B::BoolTensorPrimitivewhere
B: FusionBackend<FusionRuntime = R>,
Resolve the given bool tensor to a primitive tensor.
Auto Trait Implementations§
impl<R> Freeze for MutexFusionClient<R>
impl<R> !RefUnwindSafe for MutexFusionClient<R>
impl<R> Send for MutexFusionClient<R>
impl<R> Sync for MutexFusionClient<R>
impl<R> Unpin for MutexFusionClient<R>
impl<R> !UnwindSafe for MutexFusionClient<R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more