pub trait Numeric:
Copy
+ Abs
+ Max
+ Min
+ Clamp
+ Remainder
+ CubePrimitive
+ LaunchArgExpand<CompilationArg = ()>
+ ScalarArgSettings
+ ExpandElementBaseInit
+ Into<ExpandElementTyped<Self>>
+ CubeIndexMut<u32, Output = Self>
+ CubeIndexMut<ExpandElementTyped<u32>, Output = Self>
+ NumCast
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ PartialOrd
+ PartialEq {
// Required methods
fn min_value() -> Self;
fn max_value() -> Self;
// Provided methods
fn __expand_min_value(
context: &mut CubeContext,
) -> <Self as CubeType>::ExpandType { ... }
fn __expand_max_value(
context: &mut CubeContext,
) -> <Self as CubeType>::ExpandType { ... }
fn from_int(val: i64) -> Self { ... }
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: [u32; D],
) -> <Self as CubeType>::ExpandType { ... }
}
Expand description
Type that encompasses both (unsigned or signed) integers and floats Used in kernels that should work for both.
Required Methods§
Provided Methods§
fn __expand_min_value( context: &mut CubeContext, ) -> <Self as CubeType>::ExpandType
fn __expand_max_value( context: &mut CubeContext, ) -> <Self as CubeType>::ExpandType
Sourcefn from_int(val: i64) -> Self
fn from_int(val: i64) -> Self
Create a new constant numeric.
Note: since this must work for both integer and float only the less expressive of both can be created (int) If a number with decimals is needed, use Float::new.
This method panics when unexpanded. For creating an element with a val, use the new method of the sub type.
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: [u32; D], ) -> <Self as CubeType>::ExpandType
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.