pub struct NativeOps<const FUSED: bool> {
pub tolerance: Option<f64>,
}Expand description
Scalar instantiation of the same formulae used by slice kernels and graph lowering.
Fields§
§tolerance: Option<f64>Implementations§
Trait Implementations§
impl<const FUSED: bool> Copy for NativeOps<FUSED>
Source§impl<F: Float, const FUSED: bool> Ops<F> for NativeOps<FUSED>
impl<F: Float, const FUSED: bool> Ops<F> for NativeOps<FUSED>
fn fused(&self) -> bool
fn widen(&self, x: F) -> f64
fn wide_number(&self, x: f64) -> f64
fn wide_multiply_add(&self, x: f64, y: f64, z: f64) -> f64
fn narrow(&self, x: f64) -> F
fn width(&self) -> FloatWidth
fn integer(&self, x: i64) -> u64
fn integer_op(&self, op: Integer, x: u64, y: u64) -> u64
fn integer_compare(&self, op: Cmp, x: u64, y: u64) -> bool
fn integer_select(&self, test: bool, x: u64, y: u64) -> u64
fn to_integer(&self, x: F) -> u64
fn from_integer(&self, x: u64) -> F
fn to_bits(&self, x: F) -> u64
fn from_bits(&self, x: u64) -> F
fn unary(&self, op: Unary, x: F) -> F
fn binary(&self, op: Binary, x: F, y: F) -> F
fn compare(&self, c: Cmp, x: F, y: F) -> bool
fn and(&self, x: bool, y: bool) -> bool
fn or(&self, x: bool, y: bool) -> bool
fn not(&self, x: bool) -> bool
Source§fn select(&self, test: bool, x: F, y: F) -> F
fn select(&self, test: bool, x: F, y: F) -> F
x where m holds, otherwise y. ∂’s recorder runs a recipe on whole values, where m and each array case must have one layout: build them from the same arguments.Source§fn multiply_add(&self, x: F, y: F, z: F) -> F
fn multiply_add(&self, x: F, y: F, z: F) -> F
x·y + z, rounded once where the target fuses multiply-add (FUSED), as rustymath’s mla gives it.fn overflow(&self, _op: Binary, _x: F, _y: F) -> bool
Source§fn constant(&self, value: F) -> Option<F>
fn constant(&self, value: F) -> Option<F>
v where it’s one number that every item shares, known before any item is read, such as the 3 of x^3. A recipe can pick a cheaper formula by it. None where v varies by item.Source§fn tolerance(&self, fallback: F) -> F
fn tolerance(&self, fallback: F) -> F
Captured tolerance; recording backends return its runtime setting slot.
Source§fn integral(&self) -> bool
fn integral(&self) -> bool
Whether values are integers, as a compiler’s values at an integer type are. A recipe for an integer object asks before taking an integer-only step (
Binary::BitAnd). Floats never are.Source§fn reciprocal(&self, x: Self::V) -> Self::V
fn reciprocal(&self, x: Self::V) -> Self::V
1 ÷ x, as reciprocal gives it.Source§fn real_power(&self, x: Self::V, y: Self::V) -> Self::V
fn real_power(&self, x: Self::V, y: Self::V) -> Self::V
The real part of
x^y through the existing power formula.Source§fn power_slope(
&self,
x: Self::V,
y: Self::V,
r: Self::V,
halves: bool,
) -> Self::V
fn power_slope( &self, x: Self::V, y: Self::V, r: Self::V, halves: bool, ) -> Self::V
The partial in
x of x^y = r; halves permits constant half-integer powers.fn negate(&self, x: Self::V) -> Self::V
fn magnitude(&self, x: Self::V) -> Self::V
fn sqrt(&self, x: Self::V) -> Self::V
fn floor(&self, x: Self::V) -> Self::V
fn ln(&self, x: Self::V) -> Self::V
fn sin(&self, x: Self::V) -> Self::V
fn cos(&self, x: Self::V) -> Self::V
fn sinh(&self, x: Self::V) -> Self::V
fn cosh(&self, x: Self::V) -> Self::V
fn sqrt1mx2(&self, x: Self::V) -> Self::V
fn sqrt1px2(&self, x: Self::V) -> Self::V
fn digamma(&self, x: Self::V) -> Self::V
fn exp(&self, x: Self::V) -> Self::V
fn lgamma(&self, x: Self::V) -> Self::V
fn complement(&self, x: Self::V) -> Self::V
fn add(&self, x: Self::V, y: Self::V) -> Self::V
fn subtract(&self, x: Self::V, y: Self::V) -> Self::V
fn multiply(&self, x: Self::V, y: Self::V) -> Self::V
fn divide(&self, x: Self::V, y: Self::V) -> Self::V
fn larger(&self, x: Self::V, y: Self::V) -> Self::V
fn smaller(&self, x: Self::V, y: Self::V) -> Self::V
fn binom(&self, x: Self::V, y: Self::V) -> Self::V
fn binom_dn(&self, x: Self::V, y: Self::V) -> Self::V
fn binom_dk(&self, x: Self::V, y: Self::V) -> Self::V
fn polygamma(&self, x: Self::V, y: Self::V) -> Self::V
fn bit_and(&self, x: Self::V, y: Self::V) -> Self::V
fn less(&self, x: Self::V, y: Self::V) -> Self::B
fn less_equal(&self, x: Self::V, y: Self::V) -> Self::B
fn equal(&self, x: Self::V, y: Self::V) -> Self::B
Auto Trait Implementations§
impl<const FUSED: bool> Forget for NativeOps<FUSED>
impl<const FUSED: bool> Freeze for NativeOps<FUSED>
impl<const FUSED: bool> RefUnwindSafe for NativeOps<FUSED>
impl<const FUSED: bool> Send for NativeOps<FUSED>
impl<const FUSED: bool> Sync for NativeOps<FUSED>
impl<const FUSED: bool> Unpin for NativeOps<FUSED>
impl<const FUSED: bool> UnsafeUnpin for NativeOps<FUSED>
impl<const FUSED: bool> UnwindSafe for NativeOps<FUSED>
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more