pub struct ExternalMemory { /* private fields */ }Expand description
An imported external-memory handle (Vulkan VkDeviceMemory, D3D12 heap, NvSciBuf, …). Destroyed on drop.
Implementations§
Source§impl ExternalMemory
impl ExternalMemory
Sourcepub unsafe fn import(
context: &Context,
desc: &CUDA_EXTERNAL_MEMORY_HANDLE_DESC,
) -> Result<Self>
pub unsafe fn import( context: &Context, desc: &CUDA_EXTERNAL_MEMORY_HANDLE_DESC, ) -> Result<Self>
Import an external-memory handle described by desc.
§Safety
desc must describe a live OS object that the calling process has
permission to access — a Vulkan-exported file descriptor, a
D3D12-exported NT HANDLE, etc. CUDA retains a reference to the
underlying object until this ExternalMemory drops.
Sourcepub fn mapped_buffer(
&self,
offset: u64,
size: u64,
flags: u32,
) -> Result<CUdeviceptr>
pub fn mapped_buffer( &self, offset: u64, size: u64, flags: u32, ) -> Result<CUdeviceptr>
Expose a subregion of the external memory as a device pointer.
The returned pointer is valid until this ExternalMemory drops.
pub fn as_raw(&self) -> CUexternalMemory
Trait Implementations§
Source§impl Clone for ExternalMemory
impl Clone for ExternalMemory
Source§fn clone(&self) -> ExternalMemory
fn clone(&self) -> ExternalMemory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExternalMemory
impl RefUnwindSafe for ExternalMemory
impl Send for ExternalMemory
impl Sync for ExternalMemory
impl Unpin for ExternalMemory
impl UnsafeUnpin for ExternalMemory
impl UnwindSafe for ExternalMemory
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