Device

Trait Device 

Source
pub trait Device:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn is_cpu(&self) -> bool;
    fn is_cuda(&self) -> bool;
}
Expand description

Trait for compute devices (CPU, CUDA, etc.)

Required Methods§

Source

fn name(&self) -> &'static str

Device name for display

Source

fn is_cpu(&self) -> bool

Check if this is a CPU device

Source

fn is_cuda(&self) -> bool

Check if this is a CUDA 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.

Implementors§