pub struct DeviceSlice<'a, T: Copy> { /* private fields */ }Expand description
A borrowed, non-owning view into a sub-range of a DeviceBuffer.
A DeviceSlice does not own the memory it points to — it borrows from
the parent DeviceBuffer and is lifetime-bound to it. This is useful
for passing sub-regions of a buffer to kernels or copy operations without
extra allocations.
DeviceSlice does not implement Drop; the parent buffer is
responsible for freeing the allocation.
Implementations§
Source§impl<T: Copy> DeviceSlice<'_, T>
impl<T: Copy> DeviceSlice<'_, T>
Sourcepub fn as_device_ptr(&self) -> CUdeviceptr
pub fn as_device_ptr(&self) -> CUdeviceptr
Returns the raw CUdeviceptr handle for the start of this slice.
Auto Trait Implementations§
impl<'a, T> Freeze for DeviceSlice<'a, T>
impl<'a, T> RefUnwindSafe for DeviceSlice<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DeviceSlice<'a, T>where
T: Sync,
impl<'a, T> Sync for DeviceSlice<'a, T>where
T: Sync,
impl<'a, T> Unpin for DeviceSlice<'a, T>
impl<'a, T> UnsafeUnpin for DeviceSlice<'a, T>
impl<'a, T> UnwindSafe for DeviceSlice<'a, T>where
T: RefUnwindSafe,
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