pub struct GpuMemoryReservation { /* private fields */ }Expand description
One atomic claim on a GpuMemoryManager budget.
The claim protects a complete multi-allocation request from competing callers. Bytes remain reserved until they are transferred to returned allocation owners or released when this token is dropped.
Implementations§
Source§impl GpuMemoryReservation
impl GpuMemoryReservation
Sourcepub fn memory_manager_ptr_value(&self) -> usize
pub fn memory_manager_ptr_value(&self) -> usize
Stable address of the memory manager that admitted this reservation.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Complete byte claim made when this reservation was created.
Sourcepub fn remaining_bytes(&self) -> u64
pub fn remaining_bytes(&self) -> u64
Bytes still available for materialization through this token.
Sourcepub fn used_bytes(&self) -> u64
pub fn used_bytes(&self) -> u64
Bytes already transferred to allocation owners.
Sourcepub fn alloc<T: DeviceRepr>(
&mut self,
len: usize,
) -> Result<TrackedCudaSlice<T>>
pub fn alloc<T: DeviceRepr>( &mut self, len: usize, ) -> Result<TrackedCudaSlice<T>>
Allocate typed device memory from this reservation.
Sourcepub fn alloc_raw(
&mut self,
bytes: usize,
tag: AllocTag,
) -> Result<RuntimeAllocBlock>
pub fn alloc_raw( &mut self, bytes: usize, tag: AllocTag, ) -> Result<RuntimeAllocBlock>
Allocate raw device bytes from this reservation through the attached runtime resource stack.
Trait Implementations§
Source§impl Debug for GpuMemoryReservation
impl Debug for GpuMemoryReservation
Source§impl Drop for GpuMemoryReservation
impl Drop for GpuMemoryReservation
Auto Trait Implementations§
impl Freeze for GpuMemoryReservation
impl RefUnwindSafe for GpuMemoryReservation
impl Send for GpuMemoryReservation
impl Sync for GpuMemoryReservation
impl Unpin for GpuMemoryReservation
impl UnsafeUnpin for GpuMemoryReservation
impl UnwindSafe for GpuMemoryReservation
Blanket Implementations§
impl<T> Allocation for T
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