pub struct GpuMemorySystem { /* private fields */ }Expand description
Unified GPU memory system
Implementations§
Source§impl GpuMemorySystem
impl GpuMemorySystem
Sourcepub fn new(config: GpuMemorySystemConfig) -> Result<Self, GpuMemorySystemError>
pub fn new(config: GpuMemorySystemConfig) -> Result<Self, GpuMemorySystemError>
Create new GPU memory system
Sourcepub fn auto_create() -> Result<Self, GpuMemorySystemError>
pub fn auto_create() -> Result<Self, GpuMemorySystemError>
Create system with auto-detected best configuration
Sourcepub fn start(&mut self) -> Result<(), GpuMemorySystemError>
pub fn start(&mut self) -> Result<(), GpuMemorySystemError>
Start the GPU memory system
Sourcepub fn allocate(
&mut self,
size: usize,
alignment: Option<usize>,
) -> Result<*mut c_void, GpuMemorySystemError>
pub fn allocate( &mut self, size: usize, alignment: Option<usize>, ) -> Result<*mut c_void, GpuMemorySystemError>
Allocate GPU memory with unified interface
Sourcepub fn reallocate(
&mut self,
ptr: *mut c_void,
new_size: usize,
) -> Result<*mut c_void, GpuMemorySystemError>
pub fn reallocate( &mut self, ptr: *mut c_void, new_size: usize, ) -> Result<*mut c_void, GpuMemorySystemError>
Reallocate memory with potential optimization
Sourcepub fn record_access(
&mut self,
ptr: *mut c_void,
access_type: AccessType,
) -> Result<(), GpuMemorySystemError>
pub fn record_access( &mut self, ptr: *mut c_void, access_type: AccessType, ) -> Result<(), GpuMemorySystemError>
Record memory access for optimization
Sourcepub fn get_memory_info(&self, ptr: *mut c_void) -> Option<&MemoryAllocation>
pub fn get_memory_info(&self, ptr: *mut c_void) -> Option<&MemoryAllocation>
Get memory information
Sourcepub fn get_stats(&mut self) -> SystemStats
pub fn get_stats(&mut self) -> SystemStats
Get system statistics
Sourcepub fn optimize(&mut self) -> Result<(), GpuMemorySystemError>
pub fn optimize(&mut self) -> Result<(), GpuMemorySystemError>
Optimize memory system based on usage patterns
Trait Implementations§
impl Send for GpuMemorySystem
impl Sync for GpuMemorySystem
Auto Trait Implementations§
impl Freeze for GpuMemorySystem
impl !RefUnwindSafe for GpuMemorySystem
impl Unpin for GpuMemorySystem
impl !UnwindSafe for GpuMemorySystem
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 more