Optimize Floating-point Operation
Starting with the oneAPI 2021.2 release, fast math is enabled by default, allowing the
Intel® oneAPI
to make various out-of-box floating point math (DPC++/C++
Compilerfloat
or
double
) optimizations. With these optimizations enabled, you might observe different bitwise results when compared to results from the oneAPI 2021.1 release or from GCC. The tradeoff is done to improve performance and area of your design. Automatic dot product inference and floating-point contraction for double precision math are two key noticeable FPGA optimizations that save a large amount of FPGA area and improve performance/latency. To return to the same precision as the oneAPI 2021.1 release or GCC, use the following compiler options:
- For Linux:-no-fma -fp-model=precise
- For Windows:/Qfma- /fp:precise
For more information about these options, refer to
.
-fp-model, fp
and
fma, Qfma
topics in the
Intel® oneAPI
Developer Guide and ReferenceDPC++/C++
CompilerFor floating-point operations, you can manually direct the
Intel® oneAPI
to perform optimizations that create more efficient pipeline structures in hardware and reduce the overall hardware use. These optimizations can cause small differences in floating-point results. You can also apply the
DPC++/C++
Compilerfp contract
and
fp reassociate
floating-point pragmas to handle kernel's arithmetic and floating-point operations at finer granularity. For more information about the pragmas, refer to
Floating Point Pragmas.