diff --git a/crates/cubecl-core/src/frontend/element/float.rs b/crates/cubecl-core/src/frontend/element/float.rs index 7de1d7b77..79fde6413 100644 --- a/crates/cubecl-core/src/frontend/element/float.rs +++ b/crates/cubecl-core/src/frontend/element/float.rs @@ -39,6 +39,19 @@ pub trait Float: + std::cmp::PartialOrd + std::cmp::PartialEq { + const DIGITS: u32 = Self::DIGITS; + const EPSILON: Self = Self::EPSILON; + const INFINITY: Self = Self::INFINITY; + const MANTISSA_DIGITS: u32 = Self::MANTISSA_DIGITS; + const MAX_10_EXP: i32 = Self::MAX_10_EXP; + const MAX_EXP: i32 = Self::MAX_EXP; + const MIN_10_EXP: i32 = Self::MIN_10_EXP; + const MIN_EXP: i32 = Self::MIN_EXP; + const MIN_POSITIVE: Self = Self::MIN_POSITIVE; + const NAN: Self = Self::NAN; + const NEG_INFINITY: Self = Self::NEG_INFINITY; + const RADIX: u32 = Self::RADIX; + fn new(val: f32) -> Self; fn vectorized(val: f32, vectorization: u32) -> Self; fn vectorized_empty(vectorization: u32) -> Self; diff --git a/crates/cubecl-core/src/frontend/element/int.rs b/crates/cubecl-core/src/frontend/element/int.rs index a498b86d7..0556d293e 100644 --- a/crates/cubecl-core/src/frontend/element/int.rs +++ b/crates/cubecl-core/src/frontend/element/int.rs @@ -40,6 +40,8 @@ pub trait Int: + std::cmp::PartialOrd + std::cmp::PartialEq { + const BITS: Self = Self::BITS; + fn new(val: i64) -> Self; fn vectorized(val: i64, vectorization: u32) -> Self; fn __expand_new(context: &mut CubeContext, val: i64) -> ::ExpandType { diff --git a/crates/cubecl-core/src/frontend/element/numeric.rs b/crates/cubecl-core/src/frontend/element/numeric.rs index 9c19b1c4f..ff5da1e54 100644 --- a/crates/cubecl-core/src/frontend/element/numeric.rs +++ b/crates/cubecl-core/src/frontend/element/numeric.rs @@ -49,6 +49,9 @@ pub trait Numeric: + std::cmp::PartialOrd + std::cmp::PartialEq { + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; + /// Create a new constant numeric. /// /// Note: since this must work for both integer and float