Trait GpuBuffer

Source
pub trait GpuBuffer: Send + Sync {
    // Required methods
    fn size(&self) -> usize;
    fn upload(&mut self, data: &[Complex64]) -> QuantRS2Result<()>;
    fn download(&self, data: &mut [Complex64]) -> QuantRS2Result<()>;
    fn sync(&self) -> QuantRS2Result<()>;
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

GPU memory buffer abstraction

Required Methods§

Source

fn size(&self) -> usize

Get the size of the buffer in bytes

Source

fn upload(&mut self, data: &[Complex64]) -> QuantRS2Result<()>

Copy data from host to device

Source

fn download(&self, data: &mut [Complex64]) -> QuantRS2Result<()>

Copy data from device to host

Source

fn sync(&self) -> QuantRS2Result<()>

Synchronize GPU operations

Source

fn as_any(&self) -> &dyn Any

Enable downcasting to concrete types

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Enable mutable downcasting to concrete types

Implementors§