BFP API quick reference#
The tables below list the functions of the block floating-point API. The “EW” column indicates whether the operation acts element-wise.
The “Signature” column is intended as a hint which quickly conveys the kind of the conceptual inputs to and outputs from the operation. The signatures are only intended to convey how many (conceptual) inputs and outputs there are, and their dimensionality.
The functions themselves will typically take more arguments than these signatures indicate. Check the function’s full documentation to get more detailed information.
The following symbols are used in the signatures:
Symbol |
Description |
---|---|
\(\mathbb{S}\) |
A scalar input or output value. |
\(\mathbb{V}\) |
A vector-valued input or output. |
\(\mathbb{M}\) |
A matrix-valued input or output. |
\(\varnothing\) |
Placeholder indicating no input or output. |
For example, the operation signature \((\mathbb{V \times V \times S}) \to \mathbb{V}\) indicates the operation takes two vector inputs and a scalar input, and the output is a vector.
32-Bit BFP API quick reference#
Function |
EW |
Signature |
Brief |
---|---|---|---|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Initialize (static) |
||
\(\varnothing \to \mathbb{V}\) |
Initialize (dynamic) |
||
\(\mathbb{V} \to \mathbb{\varnothing}\) |
Deinitialize |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Set All Elements |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Force Exponent |
||
\(\mathbb{V} \to \mathbb{S}\) |
Get Headroom |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Shift Mantissas |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Add Vector |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Add Scalar |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Subtract Vector |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Multiply Vector |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Negated Multiply-Accumulate |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Multiply Scalar |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Absolute Values |
|
\(\mathbb{V} \to \mathbb{S}\) |
Sum Elements |
||
\((\mathbb{V \times V}) \to \mathbb{S}\) |
Inner Product |
||
x |
\((\mathbb{V \times S \times S}) \to \mathbb{V}\) |
Clip Bounds |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Rectify Elements |
|
\(\mathbb{V} \to \mathbb{V}\) |
Convert to 16-bit |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Square Root |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Multiplicative Inverse |
|
\(\mathbb{V} \to \mathbb{S}\) |
Absolute Sum Elements |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Mean Value |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Energy |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector RMS Value |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Max Element |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Min Element |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Elementwise Max |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Elementwise Min |
|
\(\mathbb{V} \to \mathbb{S}\) |
Max Element Index |
||
\(\mathbb{V} \to \mathbb{S}\) |
Min Element Index |
||
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Convolve With Kernel (Valid mode) |
||
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Convolve With Kernel (Same mode) |
16-Bit BFP API quick reference#
Function |
EW |
Signature |
Brief |
---|---|---|---|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Initialize (static) |
||
\(\varnothing \to \mathbb{V}\) |
Initialize (dynamic) |
||
\(\mathbb{V} \to \mathbb{\varnothing}\) |
Deinitialize |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Set All Elements |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Force Exponent |
||
\(\mathbb{V} \to \mathbb{S}\) |
Get Headroom |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Shift Mantissas |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Add Vector |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Add Scalar |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Subtract Vector |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Multiply Vector |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Negated Multiply-Accumulate |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Multiply Scalar |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Absolute Values |
|
\(\mathbb{V} \to \mathbb{S}\) |
Sum Elements |
||
\((\mathbb{V \times V}) \to \mathbb{S}\) |
Inner Product |
||
x |
\((\mathbb{V \times S \times S}) \to \mathbb{V}\) |
Clip Bounds |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Rectify Elements |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Convert to 32-bit |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Square Root |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Multiplicative Inverse |
|
\(\mathbb{V} \to \mathbb{V}\) |
Absolute Sum Elements |
||
\(\mathbb{V} \to \mathbb{V}\) |
Vector Mean Value |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Energy |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector RMS Value |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Max Element |
||
\(\mathbb{V} \to \mathbb{S}\) |
Vector Min Element |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Elementwise Max |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Elementwise Min |
|
\(\mathbb{V} \to \mathbb{S}\) |
Max Element Index |
||
\(\mathbb{V} \to \mathbb{S}\) |
Min Element Index |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Elementwise Accumulate |
Complex 32-bit BFP API quick reference#
Function |
EW |
Signature |
Brief |
---|---|---|---|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Initialize (static) |
||
\(\varnothing \to \mathbb{V}\) |
Initialize (dynamic) |
||
\(\mathbb{V} \to \mathbb{\varnothing}\) |
Deinitialize |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Set All Elements |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Force Exponent |
||
\(\mathbb{V} \to \mathbb{S}\) |
Get Headroom |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Shift Mantissas |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Real Vector Multiply |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Multiply |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Conjugate Multiply |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Negated Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Conjugate Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Negated Conjugate Multiply-Accumulate |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Real Scalar Multiply |
||
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Complex Scalar Multiply |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Add |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Complex Scalar Add |
||
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Subtract |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Convert to 16-bit |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Squared Magnitude |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Magnitude |
|
\(\mathbb{V} \to \mathbb{S}\) |
Vector Sum |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Complex Conjugate |
|
\(\mathbb{V} \to \mathbb{S}\) |
Vector Energy |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Construct Complex From Real and Imaginary |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Real Part |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Imaginary Part |
Complex 16-bit BFP API quick reference#
Function |
EW |
Signature |
Brief |
---|---|---|---|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Initialize (static) |
||
\(\varnothing \to \mathbb{V}\) |
Initialize (dynamic) |
||
\(\mathbb{V} \to \mathbb{\varnothing}\) |
Deinitialize |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Set All Elements |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Force Exponent |
||
\(\mathbb{V} \to \mathbb{S}\) |
Get Headroom |
||
x |
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Shift Mantissas |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Real Vector Multiply |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Multiply |
|
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Conjugate Multiply |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Negated Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Conjugate Multiply-Accumulate |
|
x |
\((\mathbb{V \times V \times V}) \to \mathbb{V}\) |
Complex Vector Negated Conjugate Multiply-Accumulate |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Real Scalar Multiply |
||
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Complex Scalar Multiply |
||
x |
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Add |
|
\((\mathbb{V \times S}) \to \mathbb{V}\) |
Complex Scalar Add |
||
\((\mathbb{V \times V}) \to \mathbb{V}\) |
Complex Vector Subtract |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Convert to 32-bit |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Squared Magnitude |
|
\(\mathbb{V} \to \mathbb{S}\) |
Vector Sum |
||
x |
\(\mathbb{V} \to \mathbb{V}\) |
Magnitude |
|
x |
\(\mathbb{V} \to \mathbb{V}\) |
Complex Conjugate |
|
\(\mathbb{V} \to \mathbb{S}\) |
Vector Energy |