pub struct MappedRange { /* private fields */ }Expand description
An address range with physical backing mapped in. cuMemUnmap is called
on drop; the underlying AddressRange and PhysicalMemory remain
live through their own refcounts.
Implementations§
Source§impl MappedRange
impl MappedRange
Sourcepub fn new(
range: &AddressRange,
physical: &PhysicalMemory,
offset: usize,
) -> Result<Self>
pub fn new( range: &AddressRange, physical: &PhysicalMemory, offset: usize, ) -> Result<Self>
Map physical into range at offset within the range.
offset + physical.size() <= range.size().
Sourcepub fn set_access(&self, device: &Device, flags: AccessFlags) -> Result<()>
pub fn set_access(&self, device: &Device, flags: AccessFlags) -> Result<()>
Grant flags access to device for this mapping. Must be called at
least once (typically as AccessFlags::ReadWrite) before the
mapping becomes usable — a fresh cuMemMap defaults to no access.
Sourcepub fn as_raw(&self) -> CUdeviceptr
pub fn as_raw(&self) -> CUdeviceptr
The device pointer at which the physical memory is now accessible.
pub fn size(&self) -> usize
Trait Implementations§
Source§impl Debug for MappedRange
impl Debug for MappedRange
Source§impl Drop for MappedRange
impl Drop for MappedRange
Auto Trait Implementations§
impl Freeze for MappedRange
impl RefUnwindSafe for MappedRange
impl Send for MappedRange
impl Sync for MappedRange
impl Unpin for MappedRange
impl UnsafeUnpin for MappedRange
impl UnwindSafe for MappedRange
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