pub trait FusionClient<R>:
Send
+ Sync
+ Clone
+ Sizedwhere
R: FusionRuntime<FusionClient = Self>,{
Show 17 methods
// Required methods
fn new(device: FusionDevice<R>) -> Self;
fn register<O>(
&self,
streams: OperationStreams,
repr: OperationIr,
operation: O,
)
where O: Operation<R> + 'static;
fn drain(&self);
fn device(&self) -> &FusionDevice<R>;
fn tensor_uninitialized(
&self,
shape: Vec<usize>,
dtype: DType,
) -> FusionTensor<R>;
fn register_tensor(
&self,
handle: FusionHandle<R>,
shape: Vec<usize>,
stream: StreamId,
dtype: DType,
) -> FusionTensor<R>;
fn read_tensor_float<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Send
where B: FusionBackend<FusionRuntime = R>;
fn read_tensor_int<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Send
where B: FusionBackend<FusionRuntime = R>;
fn read_tensor_bool<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Send
where B: FusionBackend<FusionRuntime = R>;
fn read_tensor_quantized<B>(
self,
tensor: TensorIr,
streams: StreamId,
) -> impl Future<Output = TensorData> + Send
where B: FusionBackend<FusionRuntime = R>;
fn resolve_tensor_float<B>(
&self,
tensor: FusionTensor<R>,
) -> B::FloatTensorPrimitive
where B: FusionBackend<FusionRuntime = R>;
fn resolve_tensor_int<B>(
&self,
tensor: FusionTensor<R>,
) -> B::IntTensorPrimitive
where B: FusionBackend<FusionRuntime = R>;
fn resolve_tensor_bool<B>(
&self,
tensor: FusionTensor<R>,
) -> B::BoolTensorPrimitive
where B: FusionBackend<FusionRuntime = R>;
fn change_client_float<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>;
fn change_client_bool<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>;
}
Expand description
Define how to interact with the fusion server.
Required Methods§
Sourcefn new(device: FusionDevice<R>) -> Self
fn new(device: FusionDevice<R>) -> Self
Create a new client for the given device.
Sourcefn 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.
Sourcefn device(&self) -> &FusionDevice<R>
fn device(&self) -> &FusionDevice<R>
Get the current device used by all operations handled by this client.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn read_tensor_int<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_int<B>(
self,
tensor: TensorIr,
stream: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by an int tensor.
Sourcefn 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.
Sourcefn read_tensor_quantized<B>(
self,
tensor: TensorIr,
streams: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
fn read_tensor_quantized<B>(
self,
tensor: TensorIr,
streams: StreamId,
) -> impl Future<Output = TensorData> + Sendwhere
B: FusionBackend<FusionRuntime = R>,
Read the values contained by a quantized tensor.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.