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§
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>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".