Skip to main content

GPUArray

Trait GPUArray 

Source
pub trait GPUArray: ArrayProtocol {
    // Required methods
    fn to_gpu(&self) -> CoreResult<Box<dyn GPUArray>>;
    fn to_cpu(&self) -> CoreResult<Box<dyn ArrayProtocol>>;
    fn is_on_gpu(&self) -> bool;
    fn device_info(&self) -> HashMap<String, String>;
}
Expand description

Trait for arrays that can support GPU operations.

Required Methods§

Source

fn to_gpu(&self) -> CoreResult<Box<dyn GPUArray>>

Move the array to GPU.

Source

fn to_cpu(&self) -> CoreResult<Box<dyn ArrayProtocol>>

Move the array from GPU to CPU.

Source

fn is_on_gpu(&self) -> bool

Check if the array is on GPU.

Source

fn device_info(&self) -> HashMap<String, String>

Get information about the GPU device that holds this array.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GPUArray for GpuNdarray<f32>

Source§

impl<T, D> GPUArray for GPUNdarray<T, D>
where T: Clone + Send + Sync + 'static + Zero + Div<f64, Output = T> + Mul<Output = T> + Add<Output = T>, D: Dimension + Clone + Send + Sync + 'static + RemoveAxis,

Source§

impl<T: Clone + Send + Sync + 'static> GPUArray for MockGPUArray<T>