Skip to content

Fast math

fast_math

FastMathFlag

Bases: StrEnum

Values specifying fast math behaviour of an arithmetic operation.

Source code in xdsl/dialects/utils/fast_math.py
 8
 9
10
11
12
13
14
15
16
17
18
19
class FastMathFlag(StrEnum):
    """
    Values specifying fast math behaviour of an arithmetic operation.
    """

    REASSOC = "reassoc"
    NO_NANS = "nnan"
    NO_INFS = "ninf"
    NO_SIGNED_ZEROS = "nsz"
    ALLOW_RECIP = "arcp"
    ALLOW_CONTRACT = "contract"
    APPROX_FUNC = "afn"

REASSOC = 'reassoc' class-attribute instance-attribute

NO_NANS = 'nnan' class-attribute instance-attribute

NO_INFS = 'ninf' class-attribute instance-attribute

NO_SIGNED_ZEROS = 'nsz' class-attribute instance-attribute

ALLOW_RECIP = 'arcp' class-attribute instance-attribute

ALLOW_CONTRACT = 'contract' class-attribute instance-attribute

APPROX_FUNC = 'afn' class-attribute instance-attribute

FastMathAttrBase dataclass

Bases: BitEnumAttribute[FastMathFlag], ABC

Base class for attributes defining fast math behavior of arithmetic operations.

Source code in xdsl/dialects/utils/fast_math.py
22
23
24
25
26
27
28
29
@dataclass(frozen=True, init=False)
class FastMathAttrBase(BitEnumAttribute[FastMathFlag], ABC):
    """
    Base class for attributes defining fast math behavior of arithmetic operations.
    """

    none_value = "none"
    all_value = "fast"

none_value = 'none' class-attribute instance-attribute

all_value = 'fast' class-attribute instance-attribute

__init__(data: DataElement) -> None