pub struct DeviceMemoryView<T> { /* private fields */ }Expand description
A checked typed device span with a strong allocation owner. Subviews and reinterpretations preserve this same owner; none expose cudarc pointer traits.
Implementations§
Source§impl<T> DeviceMemoryView<T>
impl<T> DeviceMemoryView<T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn stream(&self) -> &Arc<CudaStream> ⓘ
pub fn device_ptr(&self) -> &u64
Sourcepub fn allocation_provenance(&self) -> Option<DeviceAllocationProvenance>
pub fn allocation_provenance(&self) -> Option<DeviceAllocationProvenance>
Preserve this view’s actual native allocation origin. A foreign owner supplies only its imported span, not proof of a complete allocation; never manufacture a native allocation identity for that case.
pub fn try_slice(&self, range: impl RangeBounds<usize>) -> Option<Self>
pub fn slice(&self, range: impl RangeBounds<usize>) -> Self
pub fn slice_mut(&mut self, range: impl RangeBounds<usize>) -> Self
Sourcepub unsafe fn cast<U>(&self) -> Option<DeviceMemoryView<U>>
pub unsafe fn cast<U>(&self) -> Option<DeviceMemoryView<U>>
Reinterpret the span without changing its allocation owner.
§Safety
The initialized device bytes must have the representation required by U before any read through the returned view. Alignment and size are checked.
Trait Implementations§
Source§impl<T: DeviceRepr> AsKernelParam for &DeviceMemoryView<T>
impl<T: DeviceRepr> AsKernelParam for &DeviceMemoryView<T>
fn as_kernel_param(&self) -> *mut c_void
Source§impl<T: DeviceRepr> AsKernelParam for &mut DeviceMemoryView<T>
impl<T: DeviceRepr> AsKernelParam for &mut DeviceMemoryView<T>
fn as_kernel_param(&self) -> *mut c_void
Source§impl<T> Clone for DeviceMemoryView<T>
impl<T> Clone for DeviceMemoryView<T>
Source§impl<T> DeviceRead<T> for DeviceMemoryView<T>
impl<T> DeviceRead<T> for DeviceMemoryView<T>
fn device_view(&self) -> DeviceMemoryView<T>
Source§impl<T> DeviceSlice<T> for DeviceMemoryView<T>
impl<T> DeviceSlice<T> for DeviceMemoryView<T>
impl<T> DeviceWrite<T> for DeviceMemoryView<T>
Source§impl<'a, T: DeviceRepr> IntoKernelParamStorage for &'a DeviceMemoryView<T>
impl<'a, T: DeviceRepr> IntoKernelParamStorage for &'a DeviceMemoryView<T>
type Storage = DeviceParamStorage<'a>
fn into_kernel_param_storage(self) -> Self::Storage
Source§impl<'a, T: DeviceRepr> IntoKernelParamStorage for &'a mut DeviceMemoryView<T>
impl<'a, T: DeviceRepr> IntoKernelParamStorage for &'a mut DeviceMemoryView<T>
type Storage = DeviceParamStorage<'a>
fn into_kernel_param_storage(self) -> Self::Storage
Auto Trait Implementations§
impl<T> Freeze for DeviceMemoryView<T>
impl<T> RefUnwindSafe for DeviceMemoryView<T>where
T: RefUnwindSafe,
impl<T> Send for DeviceMemoryView<T>where
T: Send,
impl<T> Sync for DeviceMemoryView<T>where
T: Sync,
impl<T> Unpin for DeviceMemoryView<T>where
T: Unpin,
impl<T> UnsafeUnpin for DeviceMemoryView<T>
impl<T> UnwindSafe for DeviceMemoryView<T>where
T: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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