pub struct DeviceSliceMut<'a, T: DeviceRepr> { /* private fields */ }Expand description
Mutable view into a range of a DeviceBuffer.
Implementations§
Source§impl<'a, T: DeviceRepr> DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> DeviceSliceMut<'a, T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_raw(&self) -> CUdeviceptr
Sourcepub unsafe fn from_raw_parts<'b>(
ptr: CUdeviceptr,
len: usize,
) -> DeviceSliceMut<'b, T>
pub unsafe fn from_raw_parts<'b>( ptr: CUdeviceptr, len: usize, ) -> DeviceSliceMut<'b, T>
Construct a DeviceSliceMut from a raw device pointer and element count.
Mutable counterpart of DeviceSlice::from_raw_parts.
§Safety
All requirements of DeviceSlice::from_raw_parts apply, with
the additional unique-access guarantee:
- No other reference (mutable or shared) may alias the
pointed-to region for the lifetime
'b. This includes anyDeviceSlice<'_, U>constructed from the same underlying storage, even at a different element type.
Sourcepub fn slice(&self, range: Range<usize>) -> DeviceSlice<'_, T>
pub fn slice(&self, range: Range<usize>) -> DeviceSlice<'_, T>
Borrow a sub-range immutably. Panics on out-of-bounds / inverted.
Sourcepub fn slice_mut(&mut self, range: Range<usize>) -> DeviceSliceMut<'_, T>
pub fn slice_mut(&mut self, range: Range<usize>) -> DeviceSliceMut<'_, T>
Borrow a sub-range mutably.
Sourcepub fn copy_from_host_async(&self, src: &[T], stream: &Stream) -> Result<()>
pub fn copy_from_host_async(&self, src: &[T], stream: &Stream) -> Result<()>
Asynchronous H2D copy on stream. Mirrors DeviceBuffer::copy_from_host_async
for slice views — useful when the destination is a sub-range of a
larger device buffer (e.g. packing CUTLASS grouped-GEMM metadata
into a caller-supplied workspace).
Trait Implementations§
Source§impl<'a, T: DeviceRepr> Debug for DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> Debug for DeviceSliceMut<'a, T>
Source§impl<'a, T: DeviceRepr> DevicePtr<T> for DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> DevicePtr<T> for DeviceSliceMut<'a, T>
Source§impl<'a, T: DeviceRepr> DevicePtrMut<T> for DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> DevicePtrMut<T> for DeviceSliceMut<'a, T>
Source§fn device_ptr_mut(&mut self) -> CUdeviceptr
fn device_ptr_mut(&mut self) -> CUdeviceptr
Raw mutable device pointer.
Source§impl<'a, T: DeviceRepr> KernelArg for &DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> KernelArg for &DeviceSliceMut<'a, T>
fn as_kernel_arg_ptr(&self) -> *mut c_void
Source§impl<'a, T: DeviceRepr> KernelArg for &mut DeviceSliceMut<'a, T>
impl<'a, T: DeviceRepr> KernelArg for &mut DeviceSliceMut<'a, T>
fn as_kernel_arg_ptr(&self) -> *mut c_void
Auto Trait Implementations§
impl<'a, T> Freeze for DeviceSliceMut<'a, T>
impl<'a, T> RefUnwindSafe for DeviceSliceMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DeviceSliceMut<'a, T>where
T: Send,
impl<'a, T> Sync for DeviceSliceMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for DeviceSliceMut<'a, T>
impl<'a, T> UnsafeUnpin for DeviceSliceMut<'a, T>
impl<'a, T> !UnwindSafe for DeviceSliceMut<'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