cubecl_core::frontend

Struct AtomicU32

Source
pub struct AtomicU32 {
    pub val: u32,
}
Expand description

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

Fields§

§val: u32

Trait Implementations§

Source§

impl Atomic for AtomicU32

Source§

type Primitive = u32

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 AtomicU32

Source§

fn clone(&self) -> AtomicU32

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 AtomicU32

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 AtomicU32

Source§

type ExpandType = ExpandElementTyped<AtomicU32>

Source§

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

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

impl Debug for AtomicU32

Source§

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

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

impl ExpandElementBaseInit for AtomicU32

Source§

impl Hash for AtomicU32

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 IntoRuntime for AtomicU32

Source§

fn __expand_runtime_method( self, _context: &mut CubeContext, ) -> ExpandElementTyped<Self>

Source§

fn runtime(self) -> Self

Make sure a type is actually expanded into its runtime expand type.
Source§

impl LaunchArgExpand for AtomicU32

Source§

type CompilationArg = ()

Compilation argument.
Source§

fn expand( _: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> ExpandElementTyped<Self>

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

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

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

impl PartialEq for AtomicU32

Source§

fn eq(&self, other: &AtomicU32) -> 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 Copy for AtomicU32

Source§

impl Eq for AtomicU32

Source§

impl StructuralPartialEq for AtomicU32

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: CubePrimitive>( context: &mut CubeContext, value: ExpandElementTyped<From>, ) -> <Self as CubeType>::ExpandType

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: CubePrimitive>( context: &mut CubeContext, value: ExpandElementTyped<From>, ) -> <Self as CubeType>::ExpandType

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,

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