Skip to main content

SharedTile

Struct SharedTile 

Source
pub struct SharedTile<E: Numeric, IO: SliceVisibility = ReadOnly> { /* private fields */ }
Expand description

V-erased view over a shared-memory tile. Wraps a StridedTile and hides its vectorization from the type system. The underlying slice is downcast to a scalar Slice<E, IO> only at the Rust type level — the runtime vector_size on the cubecl slice is preserved, so projecting back via view::<V>() is a pure retype with no metadata change. V must match the original V the tile was wrapped with.

Implementations§

Source§

impl<E: Numeric, IO: SliceVisibility> SharedTile<E, IO>

Source

pub fn wrap<V: Size>(tile: StridedTile<E, V, IO>) -> SharedTile<E, IO>

Wrap a StridedTile whose vectorization is V. The slice is type-erased to scalar Slice<E, IO> while preserving the runtime vector_size set at allocation time. No metadata scaling is performed.

Source

pub fn view<V: Size>(&self) -> StridedTile<E, V, IO>

Project the wrapped tile back to a typed StridedTile<E, V, IO>. V must match the original V the tile was wrapped with — only the Rust type changes, the runtime layout is unchanged.

Source

pub fn __expand_wrap<V: Size>( scope: &mut Scope, tile: <StridedTile<E, V, IO> as CubeType>::ExpandType, ) -> <SharedTile<E, IO> as CubeType>::ExpandType

Source

pub fn __expand_view<V: Size>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <StridedTile<E, V, IO> as CubeType>::ExpandType

Trait Implementations§

Source§

impl<E: Clone + Numeric, IO: Clone + SliceVisibility> Clone for SharedTile<E, IO>

Source§

fn clone(&self) -> SharedTile<E, IO>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Numeric, IO: SliceVisibility> CubeType for SharedTile<E, IO>

Source§

impl<E: Copy + Numeric, IO: Copy + SliceVisibility> Copy for SharedTile<E, IO>

Auto Trait Implementations§

§

impl<E, IO> Freeze for SharedTile<E, IO>

§

impl<E, IO> RefUnwindSafe for SharedTile<E, IO>

§

impl<E, IO> Send for SharedTile<E, IO>

§

impl<E, IO> Sync for SharedTile<E, IO>

§

impl<E, IO> Unpin for SharedTile<E, IO>
where E: Unpin, IO: Unpin,

§

impl<E, IO> UnsafeUnpin for SharedTile<E, IO>

§

impl<E, IO> UnwindSafe for SharedTile<E, IO>
where E: UnwindSafe, IO: UnwindSafe,

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<C> CloneExpand for C
where C: Clone,

Source§

fn __expand_clone_method(&self, _scope: &mut Scope) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

Source§

type At<'a> = T

The concrete input type at lifetime 'a.