pub struct GpuMemoryPool { /* private fields */ }Expand description
GPU memory pool for efficient allocation
Implementations§
Source§impl GpuMemoryPool
impl GpuMemoryPool
Sourcepub fn new(strategy: AllocationStrategy) -> Self
pub fn new(strategy: AllocationStrategy) -> Self
Create new memory pool
Sourcepub fn allocate(&mut self, size: u64, device_id: u32) -> Result<u64, GpuError>
pub fn allocate(&mut self, size: u64, device_id: u32) -> Result<u64, GpuError>
Allocate memory from pool
Sourcepub fn free(&mut self, ptr: u64, device_id: u32) -> Result<(), GpuError>
pub fn free(&mut self, ptr: u64, device_id: u32) -> Result<(), GpuError>
Free memory back to pool
Sourcepub fn defragment(
&mut self,
device_id: u32,
) -> Result<DefragmentationResult, GpuError>
pub fn defragment( &mut self, device_id: u32, ) -> Result<DefragmentationResult, GpuError>
Defragment memory pool
Auto Trait Implementations§
impl Freeze for GpuMemoryPool
impl RefUnwindSafe for GpuMemoryPool
impl Send for GpuMemoryPool
impl Sync for GpuMemoryPool
impl Unpin for GpuMemoryPool
impl UnwindSafe for GpuMemoryPool
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