pub struct RawDeviceMemory<T> {
pub ptr: *mut T,
pub len: usize,
pub context: Arc<Context>,
pub stream_ordered: Option<StreamOrderedFree>,
}Expand description
Raw ownership of a device allocation, its context, and how it is freed.
Free ptr with cudaFree while context is alive, or with cudaFreeAsync on the stream in stream_ordered, or re-adopt the value with DeviceMemory::from_raw.
Fields§
§ptr: *mut TBase of the allocation, or null for an empty one.
len: usizeNumber of elements of T.
context: Arc<Context>Context the allocation belongs to.
stream_ordered: Option<StreamOrderedFree>The stream and pool of a stream-ordered allocation, or None for one freed with cudaFree.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for RawDeviceMemory<T>
impl<T> !Send for RawDeviceMemory<T>
impl<T> !Sync for RawDeviceMemory<T>
impl<T> !UnwindSafe for RawDeviceMemory<T>
impl<T> Forget for RawDeviceMemory<T>
impl<T> Freeze for RawDeviceMemory<T>
impl<T> Move for RawDeviceMemory<T>
impl<T> Unpin for RawDeviceMemory<T>
impl<T> UnsafeUnpin for RawDeviceMemory<T>where
*mut T: UnsafeUnpin,
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