pub struct ExternalMemory { /* private fields */ }Expand description
An imported external-memory handle (Vulkan VkDeviceMemory, D3D12
heap / resource, NvSciBuf, DMA-buf FD, …). Destroyed on drop.
Implementations§
Source§impl ExternalMemory
impl ExternalMemory
Sourcepub unsafe fn import(desc: &CUDA_EXTERNAL_MEMORY_HANDLE_DESC) -> Result<Self>
pub unsafe fn import(desc: &CUDA_EXTERNAL_MEMORY_HANDLE_DESC) -> Result<Self>
Import an external-memory handle described by desc.
§Safety
desc.handle must describe a live OS object that the process can
access (file descriptor, NT HANDLE, NvSciBufObj, …). CUDA
retains a reference to the underlying memory until this
ExternalMemory drops.
Sourcepub fn mapped_buffer(
&self,
offset: u64,
size: u64,
flags: u32,
) -> Result<*mut c_void>
pub fn mapped_buffer( &self, offset: u64, size: u64, flags: u32, ) -> Result<*mut c_void>
Expose a subregion of the imported memory as a device pointer valid in the current CUDA context.
Sourcepub fn as_raw(&self) -> cudaExternalMemory_t
pub fn as_raw(&self) -> cudaExternalMemory_t
Raw handle. Interchangeable with CUexternalMemory at the ABI
level — cast via as baracuda_cuda_sys::CUexternalMemory if you
need to interop with the Driver-side wrapper.
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 · 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