pub struct GPUMemoryManager {
pub total_memory: usize,
pub allocated_memory: usize,
pub allocations: HashMap<String, usize>,
}Expand description
GPU memory manager for quantum computations
Fields§
§total_memory: usizeTotal available memory
allocated_memory: usizeCurrently allocated memory
allocations: HashMap<String, usize>Memory allocations tracking
Implementations§
Source§impl GPUMemoryManager
impl GPUMemoryManager
Sourcepub fn allocate_state_vector(&mut self, size: usize) -> Result<()>
pub fn allocate_state_vector(&mut self, size: usize) -> Result<()>
Allocate memory for state vector
Sourcepub fn allocate_hamiltonian(&mut self, rows: usize, cols: usize) -> Result<()>
pub fn allocate_hamiltonian(&mut self, rows: usize, cols: usize) -> Result<()>
Allocate memory for Hamiltonian matrix
Sourcepub fn get_memory_stats(&self) -> HashMap<String, usize>
pub fn get_memory_stats(&self) -> HashMap<String, usize>
Get memory usage statistics
Trait Implementations§
Source§impl Clone for GPUMemoryManager
impl Clone for GPUMemoryManager
Source§fn clone(&self) -> GPUMemoryManager
fn clone(&self) -> GPUMemoryManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GPUMemoryManager
impl RefUnwindSafe for GPUMemoryManager
impl Send for GPUMemoryManager
impl Sync for GPUMemoryManager
impl Unpin for GPUMemoryManager
impl UnwindSafe for GPUMemoryManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more