Developer Guide

Intel oneAPI FPGA Handbook

ID 785441
Date 2/07/2024
Public

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

Document Table of Contents

Floating Point Pragmas

The following table summarizes the floating point pragmas:

Pragma Description Example
fp contract(off|fast) Controls whether the compiler can skip intermediate rounding and conversions mainly between double precision arithmetic operations.
{
  #pragma clang fp contract(fast)
  float temp1 = 0.0f, temp2 = 0.0f;
  temp1 = accessorA[0] + accessorB[0];
  temp2 = accessorC[0] + accessorD[0];
  accessorRES[0] += temp1 * temp2;
}
fp reassociate(on|off)

Controls the relaxing of the order of floating-point arithmetic operations within the code block that this pragma is applied to.

{
  #pragma clang fp reassociate(on)
  float temp1 = 0.0f, temp2 = 0.0f;
  temp1 = accessorA[0] + accessorB[0];
  temp2 = accessorC[0] + accessorD[0];
  accessorRES[0] += temp1 * temp2;
}