Skip to main content

OwnedTensorExpand

Struct OwnedTensorExpand 

Source
pub struct OwnedTensorExpand<T: CubePrimitive> { /* private fields */ }

Implementations§

Source§

impl<T: CubePrimitive> OwnedTensorExpand<T>

Source

pub fn __expand_as_slice_method<'infer, 'scope>( &'infer self, scope: &'scope Scope, ) -> &'infer <[T] as CubeType>::ExpandType

Source

pub fn __expand_as_mut_slice_method<'infer, 'scope>( &'infer mut self, scope: &'scope Scope, ) -> &'infer mut <[T] as CubeType>::ExpandType

Source

pub fn __expand_as_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer Self, ) -> &'infer <[T] as CubeType>::ExpandType

Source

pub fn __expand_as_mut_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut Self, ) -> &'infer mut <[T] as CubeType>::ExpandType

Methods from Deref<Target = TensorExpand<T>>§

Source

pub fn __expand_stride_method( &self, scope: &Scope, dim: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType

Obtain the stride of input at dimension dim

Source

pub fn __expand_shape_method( &self, scope: &Scope, dim: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType

Obtain the shape of input at dimension dim

Source

pub fn __expand_coordinate_method( &self, scope: &Scope, index: <usize as CubeType>::ExpandType, dim: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType

Obtain the coordinate corresponding to the given index of the tensor at dimension dim.

A coordinate is a list of indices corresponding to the multi-dimensional position of an element in the tensor. The dim element in a coordinate is the position along the dim dimension of the tensor.

Source

pub fn __expand_len_method( &self, scope: &Scope, ) -> <usize as CubeType>::ExpandType

The number of vectorized elements in the tensor.

§Warning

The length will be affected by the vectorization factor. To obtain the number of elements, you should multiply the length by the vectorization factor.

Source

pub fn __expand_buffer_len_method( &self, scope: &Scope, ) -> <usize as CubeType>::ExpandType

The length of the buffer representing the tensor in terms of vectorized elements.

§Warning

The buffer length will be affected by the vectorization factor. To obtain the number of elements, you should multiply the length by the vectorization factor.

Source

pub fn __expand_rank_method( &self, scope: &Scope, ) -> <usize as CubeType>::ExpandType

Returns the rank of the tensor.

Source

pub fn __expand_as_slice_method<'infer, 'scope>( &'infer self, scope: &'scope Scope, ) -> &'infer <[T] as CubeType>::ExpandType

Source

pub fn __expand_as_mut_slice_method<'infer, 'scope>( &'infer mut self, scope: &'scope Scope, ) -> &'infer mut <[T] as CubeType>::ExpandType

Methods from Deref<Target = SliceExpand<T>>§

Source

pub fn __expand_tma_load_1d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Tiled>>, destination: &mut SliceExpand<C2>, x: NativeExpand<i32>, )

Source

pub fn __expand_tma_load_2d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Tiled>>, destination: &mut SliceExpand<C2>, y: NativeExpand<i32>, x: NativeExpand<i32>, )

Source

pub fn __expand_tma_load_3d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Tiled>>, destination: &mut SliceExpand<C2>, z: NativeExpand<i32>, y: NativeExpand<i32>, x: NativeExpand<i32>, )

Source

pub fn __expand_tma_load_4d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Tiled>>, destination: &mut SliceExpand<C2>, w: NativeExpand<i32>, z: NativeExpand<i32>, y: NativeExpand<i32>, x: NativeExpand<i32>, )

Source

pub fn __expand_tma_load_5d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Tiled>>, destination: &mut SliceExpand<C2>, v: NativeExpand<i32>, w: NativeExpand<i32>, z: NativeExpand<i32>, y: NativeExpand<i32>, x: NativeExpand<i32>, )

Source

pub fn __expand_tma_load_im2col_3d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Im2col>>, destination: &mut SliceExpand<C2>, n: NativeExpand<i32>, w: NativeExpand<i32>, c: NativeExpand<i32>, w_offset: NativeExpand<u16>, )

Source

pub fn __expand_tma_load_im2col_4d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Im2col>>, destination: &mut SliceExpand<C2>, n: NativeExpand<i32>, h: NativeExpand<i32>, w: NativeExpand<i32>, c: NativeExpand<i32>, h_offset: NativeExpand<u16>, w_offset: NativeExpand<u16>, )

Source

pub fn __expand_tma_load_im2col_5d_method<C1: CubePrimitive, C2: CubePrimitive<Scalar = C1::Scalar>>( &self, scope: &Scope, source: &NativeExpand<TensorMap<C1, Im2col>>, destination: &mut SliceExpand<C2>, n: NativeExpand<i32>, d: NativeExpand<i32>, h: NativeExpand<i32>, w: NativeExpand<i32>, c: NativeExpand<i32>, d_offset: NativeExpand<u16>, h_offset: NativeExpand<u16>, w_offset: NativeExpand<u16>, )

Source

pub fn __expand_init_manual_method( &self, scope: &Scope, arrival_count: <u32 as CubeType>::ExpandType, )

Initializes a barrier with a given arrival_count. This is the number of times arrive or one of its variants needs to be called before the barrier advances.

If all units in the cube arrive on the barrier, use CUBE_DIM as the arrival count. For other purposes, only a subset may need to arrive.

§Note

No synchronization or election is performed, this is raw initialization. For shared barriers ensure only one unit performs the initialization, and synchronize the cube afterwards. There may also be additional synchronization requirements for bulk copy operations, like sync_async_proxy_shared().

Source

pub fn __expand_memcpy_async_method<C: CubePrimitive>( &self, scope: &Scope, source: &<[C] as CubeType>::ExpandType, destination: &mut <[C] as CubeType>::ExpandType, )

Copy the source slice to destination

§Safety

This will try to copy the whole source slice, so make sure source length <= destination length

Source

pub fn __expand_memcpy_async_cooperative_method<C: CubePrimitive>( &self, scope: &Scope, source: &<[C] as CubeType>::ExpandType, destination: &mut <[C] as CubeType>::ExpandType, )

Copy the source slice to destination

§Safety

This will try to copy the whole source slice, so make sure source length <= destination length

Source

pub fn __expand_memcpy_async_tx_method<C: CubePrimitive>( &self, scope: &Scope, source: &<[C] as CubeType>::ExpandType, destination: &mut <[C] as CubeType>::ExpandType, )

Copy the source slice to destination. Uses transaction count like TMA, so use with expect_tx or arrive_and_expect_tx.

§Safety

This will try to copy the whole source slice, so make sure source length <= destination length

Source

pub fn __expand_arrive_method( &self, scope: &Scope, ) -> <BarrierToken as CubeType>::ExpandType

Arrive at the barrier, decrementing arrival count

Source

pub fn __expand_arrive_and_expect_tx_method( &self, scope: &Scope, arrival_count: <u32 as CubeType>::ExpandType, transaction_count: <u32 as CubeType>::ExpandType, ) -> <BarrierToken as CubeType>::ExpandType

Arrive at the barrier, decrementing arrival count. Additionally increments expected count.

Source

pub fn __expand_expect_tx_method( &self, scope: &Scope, expected_count: <u32 as CubeType>::ExpandType, )

Increments the expected count of the barrier.

Source

pub fn __expand_arrive_and_wait_method(&self, scope: &Scope)

Wait until all data is loaded

Source

pub fn __expand_wait_method( &self, scope: &Scope, token: <BarrierToken as CubeType>::ExpandType, )

Wait at the barrier until all arrivals are done

Source

pub fn __expand_wait_parity_method( &self, scope: &Scope, phase: <u32 as CubeType>::ExpandType, )

Wait at the barrier until the phase is completed. Doesn’t require a token, but needs phase to be managed manually.

Source

pub fn __expand_commit_copy_async_method(&self, scope: &Scope)

Makes all previous copy_async operations visible on the barrier. Should be called once after all copies have been dispatched, before reading from the shared memory.

Does not count as an arrive in terms of the barrier arrival count. So arrive or arrive_and_wait should still be called afterwards.

Source

pub fn __expand_len_method(&self, scope: &Scope) -> usize

Obtain the array length

Source

pub fn __expand_len_method( &self, scope: &Scope, ) -> <usize as CubeType>::ExpandType

Source

pub fn __expand_inner_ref_method<'infer, 'scope>( &'infer self, scope: &'scope Scope, ) -> &'infer <T as CubeType>::ExpandType

Source

pub fn __expand_inner_mut_method<'infer, 'scope>( &'infer mut self, scope: &'scope Scope, ) -> &'infer mut <T as CubeType>::ExpandType

Source

pub fn __expand_free_method(&self, scope: &Scope)

Frees the shared memory for reuse, if possible on the target runtime.

§Safety

Must be used in uniform control flow Must not have any dangling references to this shared memory

Source

pub fn __extract_list(&self, scope: &Scope) -> Value

Source

pub fn __extract_offset(&self, scope: &Scope) -> NativeExpand<usize>

Source

pub fn __extract_length(&self, scope: &Scope) -> NativeExpand<usize>

Source

pub fn __expand_with_vector_size_method<'infer, N2: Size>( &'infer self, scope: &Scope, ) -> &'infer SliceExpand<Vector<E, N2>>

Source

pub fn __expand_with_vector_size_mut_method<'infer, N2: Size>( &'infer mut self, scope: &Scope, ) -> &'infer mut SliceExpand<Vector<E, N2>>

Source

pub fn __expand_as_vectorized_method( &self, _: &Scope, ) -> &SliceExpand<Vector<E::Scalar, E::Size>>

Source

pub fn __expand_as_vectorized_mut_method( &mut self, _: &Scope, ) -> &mut SliceExpand<Vector<E::Scalar, E::Size>>

Source

pub fn __expand_downcast_method<T: CubePrimitive>( &self, scope: &Scope, ) -> &SliceExpand<T>

Source

pub fn __expand_downcast_mut_method<T: CubePrimitive>( &mut self, scope: &Scope, ) -> &mut SliceExpand<T>

Source

pub fn __expand_as_ptr_method(&self, scope: &Scope) -> *const NativeExpand<E>

Source

pub fn __expand_as_mut_ptr_method( &mut self, scope: &Scope, ) -> *mut NativeExpand<E>

Source

pub fn __expand_as_mut_unchecked_method( &self, scope: &Scope, ) -> &mut SliceExpand<E>

Source

pub fn __expand_len_method(&self, scope: &Scope) -> NativeExpand<usize>

Get the length of the slice.

Source

pub fn is_empty(&self, scope: &Scope) -> NativeExpand<bool>

Returns true if the slice is empty.

Source

pub fn __expand_as_slice_method<'infer, 'scope>( &'infer self, scope: &'scope Scope, ) -> &'infer <[E] as CubeType>::ExpandType

Source

pub fn __expand_as_mut_slice_method<'infer, 'scope>( &'infer mut self, scope: &'scope Scope, ) -> &'infer mut <[E] as CubeType>::ExpandType

Source

pub fn __expand_as_slice_method<'infer, 'scope>( &'infer self, scope: &'scope Scope, ) -> &'infer <[E] as CubeType>::ExpandType

Source

pub fn __expand_as_mut_slice_method<'infer, 'scope>( &'infer mut self, scope: &'scope Scope, ) -> &'infer mut <[E] as CubeType>::ExpandType

Source

pub fn __expand_copy_from_slice_method( &mut self, scope: &Scope, source: &SliceExpand<E>, )

Source

pub fn __expand_insert_method( &mut self, scope: &Scope, index: <usize as CubeType>::ExpandType, value: <P as CubeType>::ExpandType, )

Source

pub fn size(&self) -> VectorSize

Comptime version of size.

Source

pub fn __expand_size_method(&self, _scope: &Scope) -> VectorSize

Expand method of size.

Source

pub fn __expand_equal_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being equal to the second vector.

Source

pub fn __expand_not_equal_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being not equal to the second vector.

Source

pub fn __expand_less_than_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being less than the second vector.

Source

pub fn __expand_greater_than_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being greater than the second vector.

Source

pub fn __expand_less_equal_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being less than or equal to the second vector.

Source

pub fn __expand_greater_equal_method( &self, scope: &Scope, other: &Self, ) -> <Vector<bool, N> as CubeType>::ExpandType

Return a new vector with the element-wise comparison of the first vector being greater than or equal to the second vector.

Source

pub fn __expand_load_method( &self, scope: &Scope, ) -> <Inner as CubeType>::ExpandType

Load the value of the atomic.

Source

pub fn __expand_store_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, )

Store the value of the atomic.

Source

pub fn __expand_swap_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Atomically stores the value into the atomic and returns the old value.

Source

pub fn __expand_fetch_add_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Atomically add a number to the atomic variable. Returns the old value.

Source

pub fn __expand_fetch_sub_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Atomically subtracts a number from the atomic variable. Returns the old value.

Source

pub fn __expand_fetch_max_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Atomically sets the value of the atomic variable to max(current_value, value). Returns the old value.

Source

pub fn __expand_fetch_min_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Atomically sets the value of the atomic variable to min(current_value, value). Returns the old value.

Source

pub fn __expand_compare_exchange_weak_method( &self, scope: &Scope, cmp: <Inner as CubeType>::ExpandType, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Compare the value at pointer to cmp and set it to value only if they are the same. Returns the old value of the pointer before the store.

§Tip

Compare the returned value to cmp to determine whether the store was successful.

Source

pub fn __expand_fetch_and_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Executes an atomic bitwise and operation on the atomic variable. Returns the old value.

Source

pub fn __expand_fetch_or_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Executes an atomic bitwise or operation on the atomic variable. Returns the old value.

Source

pub fn __expand_fetch_xor_method( &self, scope: &Scope, value: <Inner as CubeType>::ExpandType, ) -> <Inner as CubeType>::ExpandType

Executes an atomic bitwise xor operation on the atomic variable. Returns the old value.

Source

pub unsafe fn as_type_ref_unchecked<E: ?Sized>(&self) -> &NativeExpand<E>

Casts a reference of this expand element to a different type.

§Safety

There’s no guarantee the new type is valid for the Value

Source

pub unsafe fn as_type_mut_unchecked<E: ?Sized>( &mut self, ) -> &mut NativeExpand<E>

Casts a mutable reference of this expand element to a different type.

§Safety

There’s no guarantee the new type is valid for the Value

Source

pub fn vector_size(&self) -> VectorSize

Source

pub fn __expand_vector_size_method(&self, _scope: &Scope) -> VectorSize

Source

pub fn constant(&self) -> Option<ConstantValue>

Get the ConstantValue from the variable.

Trait Implementations§

Source§

impl<T: CubePrimitive> AsMutExpand for OwnedTensorExpand<T>

Source§

fn __expand_ref_mut_method(&mut self, _: &Scope) -> &mut Self

Source§

fn __expand_as_mut_method(&mut self, scope: &Scope) -> &mut T

Source§

impl<T: CubePrimitive> AsRefExpand for OwnedTensorExpand<T>

Source§

fn __expand_ref_method(&self, _: &Scope) -> &Self

Source§

fn __expand_as_ref_method(&self, scope: &Scope) -> &T

Source§

impl<T: Clone + CubePrimitive> Clone for OwnedTensorExpand<T>

Source§

fn clone(&self) -> OwnedTensorExpand<T>

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<T: CubePrimitive> CubeDebug for OwnedTensorExpand<T>

Source§

fn set_debug_name(&self, scope: &Scope, name: &'static str)

Set the debug name of this type’s expansion. Should do nothing for types that don’t appear at runtime
Source§

impl<T: CubePrimitive> Deref for OwnedTensorExpand<T>

Source§

type Target = TensorExpand<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: CubePrimitive> DerefMut for OwnedTensorExpand<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: CubePrimitive> ExpandTypeClone for OwnedTensorExpand<T>

Source§

fn clone_unchecked(&self) -> Self

Unchecked clone that only clones the conceptual runtime value. Should only be used in cases where each copy is used in a mutually exclusive branch (i.e. match, runtime enums). This is intentionally separated from Rust’s Clone semantics and should only be used for the conceptual expand values, never real data. Using two values in the same branch is undefined behaviour.
Source§

impl<'a, E: CubePrimitive> From<&'a OwnedTensorExpand<E>> for &'a TensorExpand<E>

Source§

fn from(value: &'a OwnedTensorExpand<E>) -> Self

Converts to this type from the input type.
Source§

impl<'a, E: CubePrimitive> From<&'a mut OwnedTensorExpand<E>> for &'a mut TensorExpand<E>

Source§

fn from(value: &'a mut OwnedTensorExpand<E>) -> Self

Converts to this type from the input type.
Source§

impl<T: CubePrimitive> IntoExpand for OwnedTensorExpand<T>

Source§

impl<T: CubePrimitive> IntoMut for OwnedTensorExpand<T>

Source§

fn into_mut(self, scope: &Scope) -> Self

Convert the variable into a potentially new mutable variable in scope, copying if needed.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.