DeviceService

Trait DeviceService 

pub trait DeviceService: Send + 'static {
    // Required methods
    fn init(device_id: DeviceId) -> Self;
    fn utilities(&self) -> Arc<dyn Any + Sync + Send>;

    // Provided method
    fn stage() -> DeviceServiceStage { ... }
}
Expand description

Represent a service that runs on a device.

Required Methods§

fn init(device_id: DeviceId) -> Self

Initializes the service. It is only called once per device.

fn utilities(&self) -> Arc<dyn Any + Sync + Send>

Get the service utilities.

Provided Methods§

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", so this trait is not object safe.

Implementations on Foreign Types§

§

impl DeviceService for HipServer

§

fn init(device_id: DeviceId) -> HipServer

§

fn utilities(&self) -> Arc<dyn Any + Sync + Send>

§

impl DeviceService for WgpuServer

§

fn init(device_id: DeviceId) -> WgpuServer

§

fn utilities(&self) -> Arc<dyn Any + Sync + Send>

Implementors§