Skip to main content

ErasedRawStridedUninitMut

Struct ErasedRawStridedUninitMut 

Source
pub struct ErasedRawStridedUninitMut<'a> { /* private fields */ }
Expand description

Borrowed dtype-erased raw strided output whose reachable elements may be uninitialized.

This descriptor is only accepted by operations that prove and perform a full overwrite of every reachable logical destination element. The backing allocation may contain non-reachable holes, which remain uninitialized.

Implementations§

Source§

impl<'a> ErasedRawStridedUninitMut<'a>

Source

pub fn from_uninit_slice<T: KernelStorageElement>( data: &'a mut [MaybeUninit<T>], dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> Result<Self>

Create an uninitialized erased output descriptor from typed storage.

Source

pub unsafe fn from_raw_parts( dtype: KernelDType, data: NonNull<u8>, byte_len: usize, dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> Result<Self>

Construct from erased uninitialized storage.

§Safety

data..data + byte_len must be an aligned, writable allocation valid for 'a, with provenance and extent sufficient for all reachable elements. The caller must ensure every reachable element is completely overwritten before it is read or exposed as initialized storage. The allocation’s alignment is an allocation property independent of the observed address, and the descriptor must have exclusive access with no mutable alias or concurrent mutation during use.

Source

pub fn data_as_uninit_mut<T: KernelStorageElement>( &mut self, ) -> Result<&mut [MaybeUninit<T>]>

Borrow the uninitialized storage as its concrete scalar type.

Source

pub fn dtype(&self) -> KernelDType

Source

pub fn dims(&self) -> &'a [usize]

Source

pub fn strides(&self) -> &'a [isize]

Source

pub fn offset(&self) -> isize

Trait Implementations§

Source§

impl<'a> Debug for ErasedRawStridedUninitMut<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.