Struct cubecl_core::frontend::UInt
source · pub struct UInt {
pub val: u32,
pub vectorization: u8,
}
Expand description
An unsigned int. Preferred for indexing operations
Fields§
§val: u32
§vectorization: u8
Implementations§
source§impl UInt
impl UInt
pub const fn new(val: u32) -> Self
pub fn vectorized(val: u32, vectorization: UInt) -> Self
pub fn __expand_new( context: &mut CubeContext, val: <Self as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType
pub fn __expand_vectorized( context: &mut CubeContext, val: <Self as CubeType>::ExpandType, vectorization: UInt, ) -> <Self as CubeType>::ExpandType
Trait Implementations§
source§impl Abs for UInt
impl Abs for UInt
fn abs(x: Self) -> Self
fn __expand_abs( context: &mut CubeContext, x: Self::ExpandType, ) -> ExpandElementTyped<Self>
source§impl AddAssign<u32> for UInt
impl AddAssign<u32> for UInt
source§fn add_assign(&mut self, _rhs: u32)
fn add_assign(&mut self, _rhs: u32)
Performs the
+=
operation. Read moresource§impl AddAssign for UInt
impl AddAssign for UInt
source§fn add_assign(&mut self, _rhs: Self)
fn add_assign(&mut self, _rhs: Self)
Performs the
+=
operation. Read moresource§impl Clamp for UInt
impl Clamp for UInt
source§fn clamp(input: Self, min_value: Self, max_value: Self) -> Self
fn clamp(input: Self, min_value: Self, max_value: Self) -> Self
Clamp the input value between the max and min values provided.
fn __expand_clamp( context: &mut CubeContext, input: Self::ExpandType, min_value: Self::ExpandType, max_value: Self::ExpandType, ) -> Self::ExpandType
source§impl ComptimeType for UInt
impl ComptimeType for UInt
source§fn into_expand(self) -> Self::ExpandType
fn into_expand(self) -> Self::ExpandType
Create the expand type from the normal type.
source§impl CubePrimitive for UInt
impl CubePrimitive for UInt
fn from_expand_elem(elem: ExpandElement) -> Self::ExpandType
source§impl CubeType for UInt
impl CubeType for UInt
type ExpandType = ExpandElementTyped<UInt>
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 DivAssign<u32> for UInt
impl DivAssign<u32> for UInt
source§fn div_assign(&mut self, _rhs: u32)
fn div_assign(&mut self, _rhs: u32)
Performs the
/=
operation. Read moresource§impl DivAssign for UInt
impl DivAssign for UInt
source§fn div_assign(&mut self, _rhs: Self)
fn div_assign(&mut self, _rhs: Self)
Performs the
/=
operation. Read moresource§impl ExpandElementBaseInit for UInt
impl ExpandElementBaseInit for UInt
fn init_elem(context: &mut CubeContext, elem: ExpandElement) -> ExpandElement
source§impl From<UInt> for ExpandElement
impl From<UInt> for ExpandElement
Useful for Comptime
source§impl LaunchArgExpand for UInt
impl LaunchArgExpand for UInt
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 UInt
impl Max for UInt
fn max(self, _rhs: Self) -> Self
fn __expand_max( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
source§impl Min for UInt
impl Min for UInt
fn min(self, _rhs: Self) -> Self
fn __expand_min( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
source§impl MulAssign<u32> for UInt
impl MulAssign<u32> for UInt
source§fn mul_assign(&mut self, _rhs: u32)
fn mul_assign(&mut self, _rhs: u32)
Performs the
*=
operation. Read moresource§impl MulAssign for UInt
impl MulAssign for UInt
source§fn mul_assign(&mut self, _rhs: Self)
fn mul_assign(&mut self, _rhs: Self)
Performs the
*=
operation. Read moresource§impl Numeric for UInt
impl Numeric for UInt
type Primitive = u32
fn from_vec<const D: usize>(_vec: [u32; D]) -> Self
fn __expand_from_int( _context: &mut CubeContext, val: ExpandElementTyped<I64>, ) -> <Self as CubeType>::ExpandType
fn __expand_from_vec<const D: usize>( context: &mut CubeContext, vec: [ExpandElementTyped<UInt>; D], ) -> <Self as CubeType>::ExpandType
source§impl PartialOrd<u32> for UInt
impl PartialOrd<u32> for UInt
source§impl PartialOrd for UInt
impl PartialOrd for UInt
source§impl Remainder for UInt
impl Remainder for UInt
fn rem(self, _rhs: Self) -> Self
fn __expand_rem( context: &mut CubeContext, lhs: ExpandElementTyped<Self>, rhs: ExpandElementTyped<Self>, ) -> ExpandElementTyped<Self>
source§impl SubAssign<u32> for UInt
impl SubAssign<u32> for UInt
source§fn sub_assign(&mut self, _rhs: u32)
fn sub_assign(&mut self, _rhs: u32)
Performs the
-=
operation. Read moresource§impl SubAssign for UInt
impl SubAssign for UInt
source§fn sub_assign(&mut self, _rhs: Self)
fn sub_assign(&mut self, _rhs: Self)
Performs the
-=
operation. Read moresource§impl Vectorized for UInt
impl Vectorized for UInt
impl Copy for UInt
impl Eq for UInt
Auto Trait Implementations§
impl Freeze for UInt
impl RefUnwindSafe for UInt
impl Send for UInt
impl Sync for UInt
impl Unpin for UInt
impl UnwindSafe for UInt
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
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> LaunchArg for Twhere
T: Numeric,
impl<T> LaunchArg for Twhere
T: Numeric,
§type RuntimeArg<'a, R: Runtime> = ScalarArg<T>
type RuntimeArg<'a, R: Runtime> = ScalarArg<T>
The runtime argument for the kernel.