pub struct KernelMemoryManager { /* private fields */ }Expand description
Kernel memory manager
Implementations§
Source§impl KernelMemoryManager
impl KernelMemoryManager
Sourcepub fn new(config: MemoryConfig) -> Self
pub fn new(config: MemoryConfig) -> Self
Create a new memory manager
Sourcepub fn config(&self) -> &MemoryConfig
pub fn config(&self) -> &MemoryConfig
Get configuration
Sourcepub async fn allocate(&self, size: u64) -> AllocResult<MemoryBuffer>
pub async fn allocate(&self, size: u64) -> AllocResult<MemoryBuffer>
Allocate GPU memory
Sourcepub async fn deallocate(&self, buffer: MemoryBuffer) -> AllocResult<()>
pub async fn deallocate(&self, buffer: MemoryBuffer) -> AllocResult<()>
Deallocate GPU memory
Sourcepub async fn allocate_staging(&self, size: u64) -> AllocResult<MemoryBuffer>
pub async fn allocate_staging(&self, size: u64) -> AllocResult<MemoryBuffer>
Allocate staging (CPU) memory
Sourcepub async fn deallocate_staging(&self, buffer: MemoryBuffer) -> AllocResult<()>
pub async fn deallocate_staging(&self, buffer: MemoryBuffer) -> AllocResult<()>
Deallocate staging memory
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get current memory statistics
Sourcepub fn bucket_stats(&self) -> Vec<BucketStats>
pub fn bucket_stats(&self) -> Vec<BucketStats>
Get bucket statistics
Sourcepub fn pressure_level(&self) -> PressureLevel
pub fn pressure_level(&self) -> PressureLevel
Get current pressure level
Sourcepub fn gpu_usage_percent(&self) -> f64
pub fn gpu_usage_percent(&self) -> f64
Get GPU usage percentage
Sourcepub async fn request_gc(&self)
pub async fn request_gc(&self)
Request garbage collection
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for KernelMemoryManager
impl !RefUnwindSafe for KernelMemoryManager
impl Send for KernelMemoryManager
impl Sync for KernelMemoryManager
impl Unpin for KernelMemoryManager
impl !UnwindSafe for KernelMemoryManager
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.