pub struct DeviceViewMut<'a, T: DeviceRepr> { /* private fields */ }Expand description
Non-owning mutable view over CUDA-accessible device memory.
This type is intentionally not Clone or Copy because it models a unique
mutable borrow of a device-memory range for the lifetime 'a.
Implementations§
Source§impl<'a, T: DeviceRepr> DeviceViewMut<'a, T>
impl<'a, T: DeviceRepr> DeviceViewMut<'a, T>
Sourcepub const unsafe fn from_raw_parts(ptr: *mut T, length: usize) -> Self
pub const unsafe fn from_raw_parts(ptr: *mut T, length: usize) -> Self
Creates a borrowed mutable device view from a raw pointer and length.
§Safety
ptr must be valid for length contiguous mutable elements of T for
the returned lifetime. If length is zero, ptr may be null; the
stored view pointer is normalized to NonNull::dangling() because safe
borrowed views should not expose null unless a vendor API explicitly
requires it. The caller must guarantee unique access to the memory
represented by the view.
pub fn from_memory(memory: &'a mut DeviceMemory<T>) -> Self
pub const fn as_ptr(&self) -> *const T
pub const fn as_mut_ptr(&mut self) -> *mut T
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn as_view(&self) -> DeviceView<'_, T>
pub fn slice<R: RangeBounds<usize>>( &self, range: R, ) -> Result<DeviceView<'_, T>>
pub fn slice_mut<R: RangeBounds<usize>>( &mut self, range: R, ) -> Result<DeviceViewMut<'_, T>>
pub fn split_at_mut( &mut self, mid: usize, ) -> Result<(DeviceViewMut<'_, T>, DeviceViewMut<'_, T>)>
Trait Implementations§
Source§impl<'a, T: Debug + DeviceRepr> Debug for DeviceViewMut<'a, T>
impl<'a, T: Debug + DeviceRepr> Debug for DeviceViewMut<'a, T>
Source§impl<T: DeviceRepr> DeviceSlice<T> for DeviceViewMut<'_, T>
impl<T: DeviceRepr> DeviceSlice<T> for DeviceViewMut<'_, T>
Source§impl<T: DeviceRepr> DeviceSliceMut<T> for DeviceViewMut<'_, T>
impl<T: DeviceRepr> DeviceSliceMut<T> for DeviceViewMut<'_, T>
fn as_device_mut_ptr(&mut self) -> *mut T
Source§impl<T: DeviceRepr> PushKernelArg for &DeviceViewMut<'_, T>
impl<T: DeviceRepr> PushKernelArg for &DeviceViewMut<'_, T>
fn push_to<'a>(self, params: &mut KernelParameters<'a>)
Source§impl<T: DeviceRepr> PushKernelArg for &mut DeviceViewMut<'_, T>
impl<T: DeviceRepr> PushKernelArg for &mut DeviceViewMut<'_, T>
fn push_to<'a>(self, params: &mut KernelParameters<'a>)
Auto Trait Implementations§
impl<'a, T> !Send for DeviceViewMut<'a, T>
impl<'a, T> !Sync for DeviceViewMut<'a, T>
impl<'a, T> !UnwindSafe for DeviceViewMut<'a, T>
impl<'a, T> Freeze for DeviceViewMut<'a, T>
impl<'a, T> RefUnwindSafe for DeviceViewMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Unpin for DeviceViewMut<'a, T>
impl<'a, T> UnsafeUnpin for DeviceViewMut<'a, T>
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