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§
Sourcepub fn wrap<V: Size>(tile: StridedTile<E, V, IO>) -> SharedTile<E, IO>
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.
Sourcepub fn view<V: Size>(&self) -> StridedTile<E, V, IO>
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.
pub fn __expand_wrap<V: Size>( scope: &mut Scope, tile: <StridedTile<E, V, IO> as CubeType>::ExpandType, ) -> <SharedTile<E, IO> as CubeType>::ExpandType
pub fn __expand_view<V: Size>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <StridedTile<E, V, IO> as CubeType>::ExpandType
Trait Implementations§
Source§fn clone(&self) -> SharedTile<E, IO>
fn clone(&self) -> SharedTile<E, IO>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more