pub enum FastMath {
    None,
    NotNaN,
    NotInf,
    UnsignedZero,
    AllowReciprocal,
    AllowContraction,
    AllowReassociation,
    AllowTransform,
    ReducedPrecision,
}Expand description
Unchecked optimizations for float operations. May cause precision differences, or undefined behaviour if the relevant conditions are not followed.
Variants§
None
Disable unsafe optimizations
NotNaN
Assume values are never NaN. If they are, the result is considered undefined behaviour.
NotInf
Assume values are never Inf/-Inf. If they are, the result is considered undefined
behaviour.
UnsignedZero
Ignore sign on zero values.
AllowReciprocal
Allow swapping float division with a reciprocal, even if that swap would change precision.
AllowContraction
Allow contracting float operations into fewer operations, even if the precision could change.
AllowReassociation
Allow reassociation for float operations, even if the precision could change.
AllowTransform
Allow all mathematical transformations for float operations, including contraction and reassociation, even if the precision could change.
ReducedPrecision
Allow using lower precision intrinsics (CUDA --use_fast_math)
Also impacts NaN, Inf and signed zero handling, as well as subnormals and rounding.
Notable edge case:
powf - Returns NaN for negative bases
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FastMath
 
impl<'de> Deserialize<'de> for FastMath
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Source§impl EnumSetConstHelper for FastMath
 
impl EnumSetConstHelper for FastMath
Source§const CONST_INIT_HELPER: __EnumSetInitHelper = __EnumSetInitHelper
 
const CONST_INIT_HELPER: __EnumSetInitHelper = __EnumSetInitHelper
ConstInitHelper.Source§const CONST_OP_HELPER: __EnumSetOpHelper = __EnumSetOpHelper
 
const CONST_OP_HELPER: __EnumSetOpHelper = __EnumSetOpHelper
ConstOpHelper.Source§type ConstInitHelper = __EnumSetInitHelper
 
type ConstInitHelper = __EnumSetInitHelper
Source§type ConstOpHelper = __EnumSetOpHelper
 
type ConstOpHelper = __EnumSetOpHelper
Source§impl EnumSetTypePrivate for FastMath
 
impl EnumSetTypePrivate for FastMath
Source§const ALL_BITS: Self::Repr = {transmute(0x01ff): <frontend::options::FastMath as enumset::__internal::EnumSetTypePrivate>::Repr}
 
const ALL_BITS: Self::Repr = {transmute(0x01ff): <frontend::options::FastMath as enumset::__internal::EnumSetTypePrivate>::Repr}
Source§const VARIANT_COUNT: u32 = 9u32
 
const VARIANT_COUNT: u32 = 9u32
Source§fn enum_into_u32(self) -> u32
 
fn enum_into_u32(self) -> u32
Source§unsafe fn enum_from_u32(val: u32) -> Self
 
unsafe fn enum_from_u32(val: u32) -> Self
Source§unsafe fn enum_from_u32_checked(val: u32) -> Self
 
unsafe fn enum_from_u32_checked(val: u32) -> Self
impl Copy for FastMath
impl EnumSetType for FastMath
impl Eq for FastMath
Auto Trait Implementations§
impl Freeze for FastMath
impl RefUnwindSafe for FastMath
impl Send for FastMath
impl Sync for FastMath
impl Unpin for FastMath
impl UnwindSafe for FastMath
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.