Skip to main content

Device

Trait Device 

Source
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§

Source

fn from_id(device_id: DeviceId) -> Self

Create a device from its id.

Source

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".

Implementors§