pub struct PinnedStorage { /* private fields */ }Expand description
CUDA pinned host memory allocated via cudaHostAlloc.
Implementations§
Source§impl PinnedStorage
impl PinnedStorage
Sourcepub fn new(len: usize) -> Result<Self>
pub fn new(len: usize) -> Result<Self>
Allocate new pinned memory of the given size.
§Arguments
len- Size in bytes to allocatedevice_id- CUDA device to associate with the allocation
Sourcepub unsafe fn as_ptr(&self) -> *const u8
pub unsafe fn as_ptr(&self) -> *const u8
Get a pointer to the underlying memory.
§Safety
The caller must ensure the pointer is not used after this storage is dropped.
Sourcepub unsafe fn as_mut_ptr(&mut self) -> *mut u8
pub unsafe fn as_mut_ptr(&mut self) -> *mut u8
Get a mutable pointer to the underlying memory.
§Safety
The caller must ensure the pointer is not used after this storage is dropped and that there are no other references to this memory.
Trait Implementations§
Source§impl Debug for PinnedStorage
impl Debug for PinnedStorage
Source§impl Drop for PinnedStorage
impl Drop for PinnedStorage
Source§impl MemoryDescription for PinnedStorage
impl MemoryDescription for PinnedStorage
Source§fn storage_kind(&self) -> StorageKind
fn storage_kind(&self) -> StorageKind
Type of storage backing this region.
Source§fn nixl_descriptor(&self) -> Option<NixlDescriptor>
fn nixl_descriptor(&self) -> Option<NixlDescriptor>
Get the NIXL descriptor for this memory region.
Source§impl Memset for PinnedStorage
impl Memset for PinnedStorage
Source§impl NixlCompatible for PinnedStorage
impl NixlCompatible for PinnedStorage
impl Send for PinnedStorage
impl Sync for PinnedStorage
Auto Trait Implementations§
impl Freeze for PinnedStorage
impl RefUnwindSafe for PinnedStorage
impl Unpin for PinnedStorage
impl UnwindSafe for PinnedStorage
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