Skip to main content

KvDev

Trait KvDev 

Source
pub trait KvDev {
    // Required methods
    fn zeros(&self, n: usize) -> Result<CudaSlice<f32>, Box<dyn Error>>;
    fn uninit(&self, n: usize) -> Result<CudaSlice<f32>, Box<dyn Error>>;
    fn alloc_u8(&self, n: usize) -> Result<CudaSlice<u8>, Box<dyn Error>>;
    fn htod_i32(&self, v: &[i32]) -> Result<CudaSlice<i32>, Box<dyn Error>>;
    fn clone_dtod(
        &self,
        src: &CudaSlice<f32>,
    ) -> Result<CudaSlice<f32>, Box<dyn Error>>;
    fn copy_into(
        &self,
        dst: &mut CudaSlice<f32>,
        off: usize,
        src: &CudaSlice<f32>,
        len: usize,
    ) -> Result<(), Box<dyn Error>>;
    fn set_i32_one(
        &self,
        d: &mut CudaSlice<i32>,
        v: i32,
    ) -> Result<(), Box<dyn Error>>;
}
Expand description

The 7 device ops the cache needs — nothing more. Implemented by the engine (and by any future backend); all ops are stream-ordered on the implementor’s worker stream.

Required Methods§

Source

fn zeros(&self, n: usize) -> Result<CudaSlice<f32>, Box<dyn Error>>

Source

fn uninit(&self, n: usize) -> Result<CudaSlice<f32>, Box<dyn Error>>

Source

fn alloc_u8(&self, n: usize) -> Result<CudaSlice<u8>, Box<dyn Error>>

Source

fn htod_i32(&self, v: &[i32]) -> Result<CudaSlice<i32>, Box<dyn Error>>

Source

fn clone_dtod( &self, src: &CudaSlice<f32>, ) -> Result<CudaSlice<f32>, Box<dyn Error>>

Source

fn copy_into( &self, dst: &mut CudaSlice<f32>, off: usize, src: &CudaSlice<f32>, len: usize, ) -> Result<(), Box<dyn Error>>

Source

fn set_i32_one( &self, d: &mut CudaSlice<i32>, v: i32, ) -> Result<(), Box<dyn Error>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl KvDev for Engine

The memra-kv device seam (Phase D): the cache’s 7 ops delegate to the engine’s inherent methods (inherent methods win name resolution, so no recursion).