Skip to main content

TransferProvider

Trait TransferProvider 

Source
pub trait TransferProvider:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn transfer_blocking(&self, request: TransferRequest<'_>) -> Result<Tensor>;
}
Expand description

Runtime-owned transfer provider between two execution locations.

Providers are registered by source and destination endpoint. Each request also identifies the event domains assigned to those endpoints at freeze.

Required Methods§

Source

fn transfer_blocking(&self, request: TransferRequest<'_>) -> Result<Tensor>

Complete one blocking transfer into the destination execution location.

The returned tensor must be immediately readable by the destination executor. Providers must not return after merely enqueueing work on an asynchronous stream or queue. Native asynchronous transfers use the event-domain driver contract instead of this interface.

§Errors

Returns a tenferro_tensor::ErrorKind::RuntimeState or backend failure when the provider cannot materialize the destination tensor, or a validation error such as dtype, shape, placement, or buffer mismatch when the transfer request is unsupported.

Implementors§