|  | 
|  | 1 | +tilelang.language.math_intrinsics | 
|  | 2 | +================================= | 
|  | 3 | + | 
|  | 4 | +.. py:module:: tilelang.language.math_intrinsics | 
|  | 5 | +
 | 
|  | 6 | +
 | 
|  | 7 | +Functions | 
|  | 8 | +--------- | 
|  | 9 | + | 
|  | 10 | +.. autoapisummary:: | 
|  | 11 | + | 
|  | 12 | +   tilelang.language.math_intrinsics.ieee_add | 
|  | 13 | +   tilelang.language.math_intrinsics.ieee_sub | 
|  | 14 | +   tilelang.language.math_intrinsics.ieee_mul | 
|  | 15 | +   tilelang.language.math_intrinsics.ieee_fmaf | 
|  | 16 | +   tilelang.language.math_intrinsics.ieee_frcp | 
|  | 17 | +   tilelang.language.math_intrinsics.ieee_fsqrt | 
|  | 18 | +   tilelang.language.math_intrinsics.ieee_frsqrt | 
|  | 19 | +   tilelang.language.math_intrinsics.ieee_fdiv | 
|  | 20 | + | 
|  | 21 | + | 
|  | 22 | +Module Contents | 
|  | 23 | +--------------- | 
|  | 24 | + | 
|  | 25 | +.. py:function:: ieee_add(x, y, rounding_mode='rn') | 
|  | 26 | +
 | 
|  | 27 | +   IEEE-compliant addition with specified rounding mode | 
|  | 28 | + | 
|  | 29 | +   :param x: First operand. | 
|  | 30 | +   :type x: PrimExpr | 
|  | 31 | +   :param y: Second operand. | 
|  | 32 | +   :type y: PrimExpr | 
|  | 33 | +   :param rounding_mode: Rounding mode: 'rn' (round to nearest), 'rz' (round toward zero), | 
|  | 34 | +                         'ru' (round toward positive infinity), 'rd' (round toward negative infinity). | 
|  | 35 | +                         Default is 'rn'. | 
|  | 36 | +   :type rounding_mode: str, optional | 
|  | 37 | + | 
|  | 38 | +   :returns: **result** -- The result. | 
|  | 39 | +   :rtype: PrimExpr | 
|  | 40 | + | 
|  | 41 | + | 
|  | 42 | +.. py:function:: ieee_sub(x, y, rounding_mode='rn') | 
|  | 43 | +
 | 
|  | 44 | +   IEEE-compliant subtraction with specified rounding mode | 
|  | 45 | + | 
|  | 46 | +   :param x: First operand. | 
|  | 47 | +   :type x: PrimExpr | 
|  | 48 | +   :param y: Second operand. | 
|  | 49 | +   :type y: PrimExpr | 
|  | 50 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 51 | +   :type rounding_mode: str, optional | 
|  | 52 | + | 
|  | 53 | +   :returns: **result** -- The result. | 
|  | 54 | +   :rtype: PrimExpr | 
|  | 55 | + | 
|  | 56 | + | 
|  | 57 | +.. py:function:: ieee_mul(x, y, rounding_mode='rn') | 
|  | 58 | +
 | 
|  | 59 | +   IEEE-compliant multiplication with specified rounding mode | 
|  | 60 | + | 
|  | 61 | +   :param x: First operand. | 
|  | 62 | +   :type x: PrimExpr | 
|  | 63 | +   :param y: Second operand. | 
|  | 64 | +   :type y: PrimExpr | 
|  | 65 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 66 | +   :type rounding_mode: str, optional | 
|  | 67 | + | 
|  | 68 | +   :returns: **result** -- The result. | 
|  | 69 | +   :rtype: PrimExpr | 
|  | 70 | + | 
|  | 71 | + | 
|  | 72 | +.. py:function:: ieee_fmaf(x, y, z, rounding_mode='rn') | 
|  | 73 | +
 | 
|  | 74 | +   IEEE-compliant fused multiply-add with specified rounding mode | 
|  | 75 | + | 
|  | 76 | +   :param x: First operand. | 
|  | 77 | +   :type x: PrimExpr | 
|  | 78 | +   :param y: Second operand. | 
|  | 79 | +   :type y: PrimExpr | 
|  | 80 | +   :param z: Third operand (addend). | 
|  | 81 | +   :type z: PrimExpr | 
|  | 82 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 83 | +   :type rounding_mode: str, optional | 
|  | 84 | + | 
|  | 85 | +   :returns: **result** -- The result of x * y + z. | 
|  | 86 | +   :rtype: PrimExpr | 
|  | 87 | + | 
|  | 88 | + | 
|  | 89 | +.. py:function:: ieee_frcp(x, rounding_mode='rn') | 
|  | 90 | +
 | 
|  | 91 | +   IEEE-compliant reciprocal with specified rounding mode | 
|  | 92 | + | 
|  | 93 | +   :param x: Input operand. | 
|  | 94 | +   :type x: PrimExpr | 
|  | 95 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 96 | +   :type rounding_mode: str, optional | 
|  | 97 | + | 
|  | 98 | +   :returns: **result** -- The result of 1/x. | 
|  | 99 | +   :rtype: PrimExpr | 
|  | 100 | + | 
|  | 101 | + | 
|  | 102 | +.. py:function:: ieee_fsqrt(x, rounding_mode='rn') | 
|  | 103 | +
 | 
|  | 104 | +   IEEE-compliant square root with specified rounding mode | 
|  | 105 | + | 
|  | 106 | +   :param x: Input operand. | 
|  | 107 | +   :type x: PrimExpr | 
|  | 108 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 109 | +   :type rounding_mode: str, optional | 
|  | 110 | + | 
|  | 111 | +   :returns: **result** -- The result of sqrt(x). | 
|  | 112 | +   :rtype: PrimExpr | 
|  | 113 | + | 
|  | 114 | + | 
|  | 115 | +.. py:function:: ieee_frsqrt(x) | 
|  | 116 | +
 | 
|  | 117 | +   IEEE-compliant reciprocal square root (round to nearest only) | 
|  | 118 | + | 
|  | 119 | +   :param x: Input operand. | 
|  | 120 | +   :type x: PrimExpr | 
|  | 121 | + | 
|  | 122 | +   :returns: **result** -- The result of 1/sqrt(x). | 
|  | 123 | +   :rtype: PrimExpr | 
|  | 124 | + | 
|  | 125 | + | 
|  | 126 | +.. py:function:: ieee_fdiv(x, y, rounding_mode='rn') | 
|  | 127 | +
 | 
|  | 128 | +   IEEE-compliant division with specified rounding mode | 
|  | 129 | + | 
|  | 130 | +   :param x: Dividend. | 
|  | 131 | +   :type x: PrimExpr | 
|  | 132 | +   :param y: Divisor. | 
|  | 133 | +   :type y: PrimExpr | 
|  | 134 | +   :param rounding_mode: Rounding mode: 'rn', 'rz', 'ru', 'rd'. Default is 'rn'. | 
|  | 135 | +   :type rounding_mode: str, optional | 
|  | 136 | + | 
|  | 137 | +   :returns: **result** -- The result of x/y. | 
|  | 138 | +   :rtype: PrimExpr | 
|  | 139 | + | 
|  | 140 | + | 
0 commit comments