Struct cubecl_core::frontend::AtomicUInt

source ·
pub struct AtomicUInt {
    pub val: u32,
    pub vectorization: u8,
}
Expand description

An atomic version of UInt. Can only be acted on atomically. An atomic unsigned int.

Fields§

§val: u32§vectorization: u8

Trait Implementations§

source§

impl Atomic for AtomicUInt

§

type Primitive = UInt

The numeric primitive represented by the atomic wrapper.
source§

fn load(pointer: &Self) -> Self::Primitive

Load the value of the atomic.
source§

fn store(pointer: &Self, value: Self::Primitive)

Store the value of the atomic.
source§

fn swap(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn compare_and_swap( pointer: &Self, cmp: Self::Primitive, value: Self::Primitive, ) -> Self::Primitive

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. Read more
source§

fn add(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn sub(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn max(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn min(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn and(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn or(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn xor(pointer: &Self, value: Self::Primitive) -> Self::Primitive

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

fn __expand_load( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_store( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, )

source§

fn __expand_swap( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_compare_and_swap( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, cmp: <Self::Primitive as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_add( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_sub( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_max( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_min( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_and( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_or( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

fn __expand_xor( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType

source§

impl Clone for AtomicUInt

source§

fn clone(&self) -> AtomicUInt

Returns a copy 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 CubePrimitive for AtomicUInt

source§

fn as_elem() -> Elem

Return the element type to use on GPU
source§

fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType

source§

impl CubeType for AtomicUInt

§

type ExpandType = ExpandElementTyped<AtomicUInt>

source§

fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType

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

impl Debug for AtomicUInt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ExpandElementBaseInit for AtomicUInt

source§

impl Hash for AtomicUInt

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LaunchArgExpand for AtomicUInt

source§

fn expand( builder: &mut KernelBuilder, vectorization: Vectorization, ) -> ExpandElementTyped<Self>

Register an input variable during compilation that fill the KernelBuilder.
source§

fn expand_output( builder: &mut KernelBuilder, vectorization: Vectorization, ) -> <Self as CubeType>::ExpandType

Register an output variable during compilation that fill the KernelBuilder.
source§

impl Max for AtomicUInt

source§

fn max(self, _rhs: Self) -> Self

source§

fn __expand_max( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>

source§

impl PartialEq for AtomicUInt

source§

fn eq(&self, other: &AtomicUInt) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Vectorized for AtomicUInt

source§

fn vectorization_factor(&self) -> UInt

source§

fn vectorize(self, factor: UInt) -> Self

source§

impl Copy for AtomicUInt

source§

impl Eq for AtomicUInt

source§

impl StructuralPartialEq for AtomicUInt

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<P> BitCast for P
where P: CubePrimitive,

source§

fn bitcast_from<From: CubePrimitive>(value: From) -> Self

Reinterpret the bits of another primitive as this primitive without conversion.
source§

fn __expand_bitcast_from<From>( context: &mut CubeContext, value: From, ) -> <Self as CubeType>::ExpandType
where From: Into<ExpandElement>,

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<P> Cast for P
where P: CubePrimitive,

source§

fn cast_from<From>(_value: From) -> P
where From: CubePrimitive,

source§

fn __expand_cast_from<From>( context: &mut CubeContext, value: From, ) -> <Self as CubeType>::ExpandType
where From: Into<ExpandElement>,

source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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,

§

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>,

§

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>,

§

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