Struct Barrier

Source
pub struct Barrier<C: CubePrimitive> { /* private fields */ }
Expand description

A mechanism for awaiting on asynchronous data transfers Behaviour is defined by its BarrierLevel.

Implementations§

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_2d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, y: i32, x: i32, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_2d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, y: ExpandElementTyped<i32>, x: ExpandElementTyped<i32>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_3d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, z: i32, y: i32, x: i32, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_3d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, z: ExpandElementTyped<i32>, y: ExpandElementTyped<i32>, x: ExpandElementTyped<i32>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_4d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, w: i32, z: i32, y: i32, x: i32, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_4d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, w: ExpandElementTyped<i32>, z: ExpandElementTyped<i32>, y: ExpandElementTyped<i32>, x: ExpandElementTyped<i32>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_5d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, v: i32, w: i32, z: i32, y: i32, x: i32, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_5d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, v: ExpandElementTyped<i32>, w: ExpandElementTyped<i32>, z: ExpandElementTyped<i32>, y: ExpandElementTyped<i32>, x: ExpandElementTyped<i32>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_im2col_3d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, n: i32, w: i32, c: i32, w_offset: u16, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_im2col_3d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, n: ExpandElementTyped<i32>, w: ExpandElementTyped<i32>, c: ExpandElementTyped<i32>, w_offset: ExpandElementTyped<u16>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_im2col_4d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, n: i32, h: i32, w: i32, c: i32, h_offset: u16, w_offset: u16, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_im2col_4d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, n: ExpandElementTyped<i32>, h: ExpandElementTyped<i32>, w: ExpandElementTyped<i32>, c: ExpandElementTyped<i32>, h_offset: ExpandElementTyped<u16>, w_offset: ExpandElementTyped<u16>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn tma_load_im2col_5d( &self, source: &TensorMap<C>, destination: &mut SliceMut<Line<C>>, n: i32, d: i32, h: i32, w: i32, c: i32, d_offset: u16, h_offset: u16, w_offset: u16, )

Copy a tile from a global memory source to a shared memory destination, with the provided offsets.

Source

pub fn __expand_tma_load_im2col_5d( scope: &mut Scope, expand: BarrierExpand<C>, source: ExpandElementTyped<TensorMap<C>>, destination: SliceExpand<Line<C>, ReadWrite>, n: ExpandElementTyped<i32>, d: ExpandElementTyped<i32>, h: ExpandElementTyped<i32>, w: ExpandElementTyped<i32>, c: ExpandElementTyped<i32>, d_offset: ExpandElementTyped<u16>, h_offset: ExpandElementTyped<u16>, w_offset: ExpandElementTyped<u16>, )

Source§

impl<C: CubePrimitive> Barrier<C>

Source

pub fn new(_level: BarrierLevel) -> Self

Creates a barrier using a user defined comptime barrier level

Source

pub fn new_with_tma_proxy(_level: BarrierLevel) -> Self

Creates a new barrier for use with TMA instructions. Adds a shared memory proxy barrier to the initialization.

Source

pub fn memcpy_async( &self, _source: &Slice<Line<C>>, _destination: &mut SliceMut<Line<C>>, )

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 arrive(&self)

Arrive at the barrier, decrementing arrival count

Source

pub fn arrive_tx(&self, _arrival_count: u32, _transaction_count: u32)

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

Source

pub fn expect_tx(&self, _expected_count: u32)

Increments the expected count of the barrier.

Source

pub fn wait(&self)

Wait at the barrier until all arrivals are done

Source

pub fn arrive_and_wait(&self)

Wait until all data is loaded

Source

pub fn __expand_new(scope: &mut Scope, level: BarrierLevel) -> BarrierExpand<C>

Source

pub fn __expand_new_with_tma_proxy( scope: &mut Scope, level: BarrierLevel, ) -> BarrierExpand<C>

Source

pub fn __expand_memcpy_async( scope: &mut Scope, expand: BarrierExpand<C>, source: SliceExpand<Line<C>, ReadOnly>, destination: SliceExpand<Line<C>, ReadWrite>, )

Source

pub fn __expand_arrive(scope: &mut Scope, expand: BarrierExpand<C>)

Source

pub fn __expand_arrive_tx( scope: &mut Scope, expand: BarrierExpand<C>, arrival_count: ExpandElementTyped<u32>, transaction_count: ExpandElementTyped<u32>, )

Source

pub fn __expand_expect_tx( scope: &mut Scope, expand: BarrierExpand<C>, expected_count: ExpandElementTyped<u32>, )

Source

pub fn __expand_wait(scope: &mut Scope, expand: BarrierExpand<C>)

Source

pub fn __expand_arrive_and_wait(scope: &mut Scope, expand: BarrierExpand<C>)

Trait Implementations§

Source§

impl<C: Clone + CubePrimitive> Clone for Barrier<C>

Source§

fn clone(&self) -> Barrier<C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<C: CubePrimitive> CubeType for Barrier<C>

Source§

type ExpandType = BarrierExpand<C>

Source§

fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType

Wrapper around the init method, necessary to type inference.
Source§

impl<C: Copy + CubePrimitive> Copy for Barrier<C>

Auto Trait Implementations§

§

impl<C> Freeze for Barrier<C>

§

impl<C> RefUnwindSafe for Barrier<C>
where C: RefUnwindSafe,

§

impl<C> Send for Barrier<C>

§

impl<C> Sync for Barrier<C>

§

impl<C> Unpin for Barrier<C>
where C: Unpin,

§

impl<C> UnwindSafe for Barrier<C>
where C: 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<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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V