pub struct BufferManager;
Expand description
Public interface for accessing the global buffer manager
Implementations§
Source§impl BufferManager
impl BufferManager
Sourcepub fn instance() -> Arc<Mutex<GlobalBufferManager>>
pub fn instance() -> Arc<Mutex<GlobalBufferManager>>
Get the global buffer manager instance
Sourcepub fn alloc_f64_buffer(size: usize) -> Vec<f64>
pub fn alloc_f64_buffer(size: usize) -> Vec<f64>
Allocate an f64 buffer through the global pool
Sourcepub fn free_f64_buffer(buffer: Vec<f64>)
pub fn free_f64_buffer(buffer: Vec<f64>)
Return an f64 buffer to the global pool
Sourcepub fn alloc_complex_buffer(size: usize) -> Vec<Complex64> ⓘ
pub fn alloc_complex_buffer(size: usize) -> Vec<Complex64> ⓘ
Allocate a complex buffer through the global pool
Sourcepub fn free_complex_buffer(buffer: Vec<Complex64>)
pub fn free_complex_buffer(buffer: Vec<Complex64>)
Return a complex buffer to the global pool
Sourcepub fn alloc_parameter_buffer(size: usize) -> Vec<f64>
pub fn alloc_parameter_buffer(size: usize) -> Vec<f64>
Allocate a parameter buffer for gate operations
Sourcepub fn free_parameter_buffer(buffer: Vec<f64>)
pub fn free_parameter_buffer(buffer: Vec<f64>)
Return a parameter buffer to the pool
Sourcepub fn get_memory_stats() -> MemoryStats
pub fn get_memory_stats() -> MemoryStats
Get memory usage statistics
Sourcepub fn collect_garbage()
pub fn collect_garbage()
Trigger garbage collection to reduce fragmentation
Sourcepub fn reset_stats()
pub fn reset_stats()
Reset memory usage statistics
Auto Trait Implementations§
impl Freeze for BufferManager
impl RefUnwindSafe for BufferManager
impl Send for BufferManager
impl Sync for BufferManager
impl Unpin for BufferManager
impl UnwindSafe for BufferManager
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.