Device

Trait Device 

Source
pub trait Device: Sized {
    type Ptr<T: ?Sized>: DevicePtr<T>;

    const IS_CPU: bool = false;

    // Required methods
    fn copy_from_host<T: Copy>(from: &[T], to: &mut Ref<[T], Self>);
    fn copy_to_host<T: Copy>(from: &Ref<[T], Self>, to: &mut [T]);
    fn copy<T: Copy>(from: &Ref<[T], Self>, to: &mut Ref<[T], Self>);
}
Expand description

Represents a physical device that can host memory. For example: cpu::Cpu, [cuda::Cuda]

Provided Associated Constants§

Source

const IS_CPU: bool = false

Required Associated Types§

Source

type Ptr<T: ?Sized>: DevicePtr<T>

Required Methods§

Source

fn copy_from_host<T: Copy>(from: &[T], to: &mut Ref<[T], Self>)

Source

fn copy_to_host<T: Copy>(from: &Ref<[T], Self>, to: &mut [T])

Source

fn copy<T: Copy>(from: &Ref<[T], Self>, to: &mut Ref<[T], Self>)

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§

Source§

impl Device for Cpu

Source§

const IS_CPU: bool = true

Source§

type Ptr<T: ?Sized> = *mut T