pub trait DeviceService: Send + 'static {
// Required methods
fn init(device_id: DeviceId) -> Self;
fn utilities(&self) -> ServerUtilitiesHandle;
// Provided method
fn stage() -> DeviceServiceStage { ... }
}Expand description
Represent a service that runs on a device.
Required Methods§
Sourcefn init(device_id: DeviceId) -> Self
fn init(device_id: DeviceId) -> Self
Initializes the service. It is only called once per device.
Sourcefn utilities(&self) -> ServerUtilitiesHandle
fn utilities(&self) -> ServerUtilitiesHandle
Get the service utilities.
Provided Methods§
Sourcefn stage() -> DeviceServiceStage
fn stage() -> DeviceServiceStage
Which pipeline stage this service runs on.
Services on DeviceServiceStage::Upstream produce work ahead of time (e.g. autodiff graph
construction, kernel fusion) that is consumed by DeviceServiceStage::Downstream services,
which stream kernels to the device.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".