Skip to main content

DeviceSliceMut

Struct DeviceSliceMut 

Source
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>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_raw(&self) -> CUdeviceptr

Source

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 any DeviceSlice<'_, U> constructed from the same underlying storage, even at a different element type.
Source

pub fn slice(&self, range: Range<usize>) -> DeviceSlice<'_, T>

Borrow a sub-range immutably. Panics on out-of-bounds / inverted.

Source

pub fn slice_mut(&mut self, range: Range<usize>) -> DeviceSliceMut<'_, T>

Borrow a sub-range mutably.

Source

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: DeviceRepr> DevicePtr<T> for DeviceSliceMut<'a, T>

Source§

fn device_ptr(&self) -> CUdeviceptr

Raw device pointer to element 0.
Source§

fn len(&self) -> usize

Number of T elements visible through this pointer.
Source§

fn is_empty(&self) -> bool

true if len is 0.
Source§

fn byte_size(&self) -> usize

Size in bytes (len * size_of::<T>()).
Source§

impl<'a, T: DeviceRepr> DevicePtrMut<T> for DeviceSliceMut<'a, T>

Source§

fn device_ptr_mut(&mut self) -> CUdeviceptr

Raw mutable device pointer.
Source§

impl<'a, T: DeviceRepr> KernelArg for &DeviceSliceMut<'a, T>

Source§

impl<'a, T: DeviceRepr> KernelArg for &mut DeviceSliceMut<'a, T>

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.