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
impl Atomic for AtomicUInt
source§fn swap(pointer: &Self, value: Self::Primitive) -> Self::Primitive
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
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 moresource§fn add(pointer: &Self, value: Self::Primitive) -> Self::Primitive
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
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
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
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
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
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
fn xor(pointer: &Self, value: Self::Primitive) -> Self::Primitive
Executes an atomic bitwise xor operation on the atomic variable. Returns the old value.
fn __expand_load( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_store( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, )
fn __expand_swap( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
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
fn __expand_add( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_sub( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_max( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_min( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_and( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
fn __expand_or( context: &mut CubeContext, pointer: <Self as CubeType>::ExpandType, value: <Self::Primitive as CubeType>::ExpandType, ) -> <Self::Primitive as CubeType>::ExpandType
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
impl Clone for AtomicUInt
source§fn clone(&self) -> AtomicUInt
fn clone(&self) -> AtomicUInt
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CubePrimitive for AtomicUInt
impl CubePrimitive for AtomicUInt
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType
source§impl CubeType for AtomicUInt
impl CubeType for AtomicUInt
type ExpandType = ExpandElementTyped<AtomicUInt>
source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
source§impl Debug for AtomicUInt
impl Debug for AtomicUInt
source§impl ExpandElementBaseInit for AtomicUInt
impl ExpandElementBaseInit for AtomicUInt
fn init_elem(context: &mut CubeContext, elem: ExpandElement) -> ExpandElement
source§impl Hash for AtomicUInt
impl Hash for AtomicUInt
source§impl LaunchArgExpand for AtomicUInt
impl LaunchArgExpand for AtomicUInt
source§fn expand(
builder: &mut KernelBuilder,
vectorization: Vectorization,
) -> ExpandElementTyped<Self>
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
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
impl Max for AtomicUInt
fn max(self, _rhs: Self) -> Self
fn __expand_max( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
source§impl PartialEq for AtomicUInt
impl PartialEq for AtomicUInt
source§impl Vectorized for AtomicUInt
impl Vectorized for AtomicUInt
impl Copy for AtomicUInt
impl Eq for AtomicUInt
impl StructuralPartialEq for AtomicUInt
Auto Trait Implementations§
impl Freeze for AtomicUInt
impl RefUnwindSafe for AtomicUInt
impl Send for AtomicUInt
impl Sync for AtomicUInt
impl Unpin for AtomicUInt
impl UnwindSafe for AtomicUInt
Blanket Implementations§
source§impl<P> BitCast for Pwhere
P: CubePrimitive,
impl<P> BitCast for Pwhere
P: CubePrimitive,
source§fn bitcast_from<From: CubePrimitive>(value: From) -> Self
fn bitcast_from<From: CubePrimitive>(value: From) -> Self
Reinterpret the bits of another primitive as this primitive without conversion.
fn __expand_bitcast_from<From>(
context: &mut CubeContext,
value: From,
) -> <Self as CubeType>::ExpandTypewhere
From: Into<ExpandElement>,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<P> Cast for Pwhere
P: CubePrimitive,
impl<P> Cast for Pwhere
P: CubePrimitive,
fn cast_from<From>(_value: From) -> Pwhere
From: CubePrimitive,
fn __expand_cast_from<From>(
context: &mut CubeContext,
value: From,
) -> <Self as CubeType>::ExpandTypewhere
From: Into<ExpandElement>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)