ViewOperations

Trait ViewOperations 

Source
pub trait ViewOperations<T: CubePrimitive, C: Coordinates>: Lined + CubeType<ExpandType: ViewOperationsExpand<T, C>> {
Show 18 methods // Provided methods fn read(&self, pos: C) -> T { ... } fn read_checked(&self, pos: C) -> T { ... } fn read_masked(&self, pos: C, value: T) -> T { ... } fn read_unchecked(&self, pos: C) -> T { ... } fn to_linear_slice(&self, pos: C, size: C) -> Slice<T, ReadOnly> { ... } fn as_tensor_map(&self) -> CubeOption<TensorMap<T>> { ... } fn tensor_map_load( &self, barrier: &Barrier, shared_memory: &mut Slice<T, ReadWrite>, pos: C, ) { ... } fn shape(&self) -> C { ... } fn is_in_bounds(&self, pos: C) -> bool { ... } fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType { ... } fn __expand_read_checked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType { ... } fn __expand_read_masked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, value: <T as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType { ... } fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType { ... } fn __expand_to_linear_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, size: <C as CubeType>::ExpandType, ) -> <Slice<T, ReadOnly> as CubeType>::ExpandType { ... } fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<T>> as CubeType>::ExpandType { ... } fn __expand_tensor_map_load( scope: &mut Scope, this: <Self as CubeType>::ExpandType, barrier: <Barrier as CubeType>::ExpandType, shared_memory: <Slice<T, ReadWrite> as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType { ... } fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <C as CubeType>::ExpandType { ... } fn __expand_is_in_bounds( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <bool as CubeType>::ExpandType { ... }
}
Expand description

Type from which we can read values in cube functions. For a mutable version, see ListMut.

Provided Methods§

Source

fn read(&self, pos: C) -> T

Source

fn read_checked(&self, pos: C) -> T

Source

fn read_masked(&self, pos: C, value: T) -> T

Source

fn read_unchecked(&self, pos: C) -> T

Source

fn to_linear_slice(&self, pos: C, size: C) -> Slice<T, ReadOnly>

Create a slice starting from pos, with size. The layout handles translation into concrete indices.

Source

fn as_tensor_map(&self) -> CubeOption<TensorMap<T>>

Source

fn tensor_map_load( &self, barrier: &Barrier, shared_memory: &mut Slice<T, ReadWrite>, pos: C, )

.Execute a TMA load into shared memory, if the underlying storage supports it. Panics if it’s unsupported.

Source

fn shape(&self) -> C

Source

fn is_in_bounds(&self, pos: C) -> bool

Source

fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_read_checked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_read_masked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, value: <T as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_to_linear_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, size: <C as CubeType>::ExpandType, ) -> <Slice<T, ReadOnly> as CubeType>::ExpandType

Source

fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<T>> as CubeType>::ExpandType

Source

fn __expand_tensor_map_load( scope: &mut Scope, this: <Self as CubeType>::ExpandType, barrier: <Barrier as CubeType>::ExpandType, shared_memory: <Slice<T, ReadWrite> as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Source

fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <C as CubeType>::ExpandType

Source

fn __expand_is_in_bounds( scope: &mut Scope, this: <Self as CubeType>::ExpandType, pos: <C as CubeType>::ExpandType, ) -> <bool as CubeType>::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: CubePrimitive, C: Coordinates, L: ViewOperations<T, C>> ViewOperations<T, C> for &'a mut L
where &'a mut L: CubeType<ExpandType = L::ExpandType>,

Source§

fn read(&self, pos: C) -> T

Source§

fn __expand_read( scope: &mut Scope, this: Self::ExpandType, pos: C::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

impl<'a, T: CubePrimitive, C: Coordinates, V: ViewOperations<T, C>> ViewOperations<T, C> for &'a V
where &'a V: CubeType<ExpandType = V::ExpandType>,

Source§

fn read(&self, pos: C) -> T

Source§

fn __expand_read( scope: &mut Scope, this: Self::ExpandType, pos: C::ExpandType, ) -> <T as CubeType>::ExpandType

Source§

impl<T: CubePrimitive> ViewOperations<T, (i32, i32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (i32, i32, i32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (i32, i32, i32, i32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (i32, i32, i32, i32, i32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (u32, u32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (u32, u32, u32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (u32, u32, u32, u32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, (u32, u32, u32, u32, u32)> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, i32> for TensorMap<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, u32> for Array<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, u32> for SharedMemory<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, u32> for Tensor<T>

Source§

impl<T: CubePrimitive> ViewOperations<T, u32> for TensorMap<T>

Source§

impl<T: CubePrimitive, IO: SliceVisibility> ViewOperations<T, u32> for Slice<T, IO>

Source§

impl<T: CubePrimitive, N: CubePrimitive + Coordinates> ViewOperations<T, Sequence<N>> for TensorMap<T>

Implementors§

Source§

impl<Q: CubePrimitive, S: CubePrimitive, F: Numeric, C: Coordinates + 'static> ViewOperations<Line<F>, C> for QuantizedView<Q, S, F, C>

Source§

impl<T: CubePrimitive, C: Coordinates, IO: Clone> ViewOperations<T, C> for View<T, C, IO>

Source§

impl<T: CubePrimitive, C: Coordinates, S: Coordinates, V> ViewOperations<T, C> for VirtualView<T, C, S, V>
where V: ViewOperations<T, S>,

Source§

impl<T: CubePrimitive, C: Coordinates, S: Coordinates, V> ViewOperations<T, C> for VirtualViewMut<T, C, S, V>
where V: ViewOperationsMut<T, S>,

Source§

impl<T: Numeric, IO: Clone> ViewOperations<Line<T>, u32> for VirtualTensor<T, IO>