Struct cubecl_core::frontend::AtomicI64
source · pub struct AtomicI64 {
pub val: i64,
pub vectorization: u8,
}
Expand description
An unsigned atomic integer. Can only be acted on atomically.
Fields§
§val: i64
§vectorization: u8
Trait Implementations§
source§impl Atomic for AtomicI64
impl Atomic for AtomicI64
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 CubePrimitive for AtomicI64
impl CubePrimitive for AtomicI64
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType
source§impl CubeType for AtomicI64
impl CubeType for AtomicI64
type ExpandType = ExpandElementTyped<AtomicI64>
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 ExpandElementBaseInit for AtomicI64
impl ExpandElementBaseInit for AtomicI64
fn init_elem(context: &mut CubeContext, elem: ExpandElement) -> ExpandElement
source§impl LaunchArgExpand for AtomicI64
impl LaunchArgExpand for AtomicI64
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 AtomicI64
impl Max for AtomicI64
fn max(self, _rhs: Self) -> Self
fn __expand_max( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
source§impl Vectorized for AtomicI64
impl Vectorized for AtomicI64
impl Copy for AtomicI64
impl Eq for AtomicI64
impl StructuralPartialEq for AtomicI64
Auto Trait Implementations§
impl Freeze for AtomicI64
impl RefUnwindSafe for AtomicI64
impl Send for AtomicI64
impl Sync for AtomicI64
impl Unpin for AtomicI64
impl UnwindSafe for AtomicI64
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
)