Intel® FPGA SDK for OpenCL™ Pro Edition: Programming Guide

ID 683846
Date 12/13/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.21. Reducing Floating-Point Rounding Operations (-ffp-contract=fast)

Include the -ffp-contract=fast option in your aoc command to direct the Intel® FPGA SDK for OpenCL™ Offline Compiler to remove intermediary floating-point rounding operations and conversions whenever possible, and to carry additional bits to maintain precision.

This flag turns on the same optimizations as the deprecated –fpc flag for all instructions, unless denoted otherwise by the fp contract pragma. For information about the fp contract pragma, refer to Floating Point Optimizations (fp contract and fp reassociate Pragma).

Note: Implementing this optimization control also changes the rounding mode. It rounds towards zero only at the end of a chain of floating-point arithmetic operations (that is, multiplications, additions, and subtractions).
To direct the offline compiler to reduce the number of rounding operations, invoke the aoc -ffp-contract=fast <your_kernel_filename>.cl command.