pub struct DeviceAllocation { /* private fields */ }Expand description
Owns a CUDA allocation independently of its typed buffers and views.
Retaining this owner keeps the allocation, context, and deallocation resources alive. Raw CUDA work must still satisfy the lifetime and ordering contract of its launch.
Implementations§
Source§impl DeviceAllocation
impl DeviceAllocation
Sourcepub const fn id(&self) -> AllocationId
pub const fn id(&self) -> AllocationId
Returns the identity shared by every buffer and view of this allocation.
Sourcepub fn as_device_ptr(&self) -> DevicePtr
pub fn as_device_ptr(&self) -> DevicePtr
Returns the allocation’s base device address.
Sourcepub const fn byte_len(&self) -> usize
pub const fn byte_len(&self) -> usize
Returns the full allocation size, independent of typed views.
Sourcepub fn stream(&self) -> Option<&Stream>
pub fn stream(&self) -> Option<&Stream>
Returns the allocation and deallocation stream for stream-ordered memory.
Sourcepub fn pool(&self) -> Option<&MemoryPool>
pub fn pool(&self) -> Option<&MemoryPool>
Returns the explicitly selected pool retained by this allocation.
Trait Implementations§
Source§impl Debug for DeviceAllocation
impl Debug for DeviceAllocation
Source§impl DeviceRegionProvider for DeviceAllocation
impl DeviceRegionProvider for DeviceAllocation
Source§fn region(&self) -> DeviceRegion<'_>
fn region(&self) -> DeviceRegion<'_>
Borrows the exact allocation range described by this provider’s pointers.
Source§impl Drop for DeviceAllocation
impl Drop for DeviceAllocation
impl Send for DeviceAllocation
impl Sync for DeviceAllocation
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceAllocation
impl !UnwindSafe for DeviceAllocation
impl Forget for DeviceAllocation
impl Freeze for DeviceAllocation
impl Move for DeviceAllocation
impl Unpin for DeviceAllocation
impl UnsafeUnpin for DeviceAllocation
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