pub struct MemHandle { /* private fields */ }Expand description
A physical VMM allocation handle. Drop releases it.
Implementations§
Source§impl MemHandle
impl MemHandle
Sourcepub fn new(
size: usize,
prop: &cudaMemAllocationProp,
flags: u64,
) -> Result<Self>
pub fn new( size: usize, prop: &cudaMemAllocationProp, flags: u64, ) -> Result<Self>
Allocate size bytes of physical memory with the given props.
Sourcepub unsafe fn from_raw(handle: cudaMemGenericAllocationHandle_t) -> Self
pub unsafe fn from_raw(handle: cudaMemGenericAllocationHandle_t) -> Self
Wrap an already-created handle.
§Safety
handle must be live and will be released when this wrapper
drops.
pub fn as_raw(&self) -> cudaMemGenericAllocationHandle_t
Sourcepub unsafe fn retain(addr: *mut c_void) -> Result<Self>
pub unsafe fn retain(addr: *mut c_void) -> Result<Self>
Retain a second reference to the allocation backing addr.
§Safety
addr must be inside a mapped VMM region.
Sourcepub fn properties(&self) -> Result<cudaMemAllocationProp>
pub fn properties(&self) -> Result<cudaMemAllocationProp>
Query the properties of the underlying allocation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemHandle
impl RefUnwindSafe for MemHandle
impl Send for MemHandle
impl Sync for MemHandle
impl Unpin for MemHandle
impl UnsafeUnpin for MemHandle
impl UnwindSafe for MemHandle
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