pub struct DeviceOutputView<'a, T: DeviceRepr> { /* private fields */ }Expand description
An exclusive write-only range for a producer of T values.
The range may be uninitialized and cannot be used as a readable device slice. Its element type describes produced values rather than the storage’s current initialization state.
Implementations§
Source§impl<'a, T: DeviceRepr> DeviceOutputView<'a, T>
impl<'a, T: DeviceRepr> DeviceOutputView<'a, T>
Sourcepub fn into_region(self) -> DeviceRegion<'a>
pub fn into_region(self) -> DeviceRegion<'a>
Consumes the typed borrow into allocation metadata without granting access.
Sourcepub unsafe fn from_raw_parts(
region: DeviceRegion<'a>,
length: usize,
) -> Result<Self>
pub unsafe fn from_raw_parts( region: DeviceRegion<'a>, length: usize, ) -> Result<Self>
Borrows an externally established writable region without claiming initialization.
§Safety
The region must remain live and exclusively writable for the returned lifetime, including queued CUDA accesses using this output.
§Errors
Returns an error if length * size_of::<T>() overflows or differs from the region’s byte length, or a nonempty region has a zero-sized element type or insufficient alignment.
Sourcepub fn from_output<B: DeviceOutput<T> + ?Sized>(output: &'a mut B) -> Self
pub fn from_output<B: DeviceOutput<T> + ?Sized>(output: &'a mut B) -> Self
Borrows writable storage without exposing its existing contents as T values.
Sourcepub fn reborrow(&mut self) -> DeviceOutputView<'_, T>
pub fn reborrow(&mut self) -> DeviceOutputView<'_, T>
Borrows this destination again for a shorter exclusive lifetime.
Sourcepub fn as_mut_ptr(&mut self) -> *mut T
pub fn as_mut_ptr(&mut self) -> *mut T
Returns the pointer a producer may write through.
Sourcepub fn slice<R: RangeBounds<usize>>(self, range: R) -> Result<Self>
pub fn slice<R: RangeBounds<usize>>(self, range: R) -> Result<Self>
Narrows this exclusive output borrow to an element range.
§Errors
Returns an error if the element range is reversed, exceeds this range’s bounds, or an inclusive bound cannot be converted without overflow.
Sourcepub fn split_at_mut(self, mid: usize) -> Result<(Self, Self)>
pub fn split_at_mut(self, mid: usize) -> Result<(Self, Self)>
Splits this exclusive output borrow into disjoint writable ranges.
§Errors
Returns an error if mid exceeds the view’s element count.