Device

Trait Device 

pub trait Device:
    Default
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn from_id(device_id: DeviceId) -> Self;
    fn to_id(&self) -> DeviceId;
}
Expand description

Device trait for all cubecl devices.

Required Methods§

fn from_id(device_id: DeviceId) -> Self

Create a device from its id.

fn to_id(&self) -> DeviceId

Retrieve the device id from 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 Device for AmdDevice

§

fn from_id(device_id: DeviceId) -> AmdDevice

§

fn to_id(&self) -> DeviceId

§

impl Device for CudaDevice

§

fn from_id(device_id: DeviceId) -> CudaDevice

§

fn to_id(&self) -> DeviceId

§

impl Device for FlexDevice

§

fn to_id(&self) -> DeviceId

§

fn from_id(_id: DeviceId) -> FlexDevice

§

impl Device for WgpuDevice

§

fn from_id(device_id: DeviceId) -> WgpuDevice

§

fn to_id(&self) -> DeviceId

Implementors§