GpuBuffer

Trait GpuBuffer 

pub trait GpuBuffer: Send + Sync {
    // Required methods
    fn size(&self) -> usize;
    fn device_ptr(&self) -> usize;
    fn copy_from_host(&self, data: &[u8]) -> Result<(), RingKernelError>;
    fn copy_to_host(&self, data: &mut [u8]) -> Result<(), RingKernelError>;
}
Expand description

Trait for GPU buffer operations.

Required Methods§

fn size(&self) -> usize

Get buffer size in bytes.

fn device_ptr(&self) -> usize

Get device pointer (as usize for FFI compatibility).

fn copy_from_host(&self, data: &[u8]) -> Result<(), RingKernelError>

Copy data from host to device.

fn copy_to_host(&self, data: &mut [u8]) -> Result<(), RingKernelError>

Copy data from device to host.

Implementations on Foreign Types§

§

impl GpuBuffer for CpuBuffer

§

fn size(&self) -> usize

§

fn device_ptr(&self) -> usize

§

fn copy_from_host(&self, data: &[u8]) -> Result<(), RingKernelError>

§

fn copy_to_host(&self, data: &mut [u8]) -> Result<(), RingKernelError>

Implementors§