Developer Guide

Intel oneAPI DPC++/C++ Compiler Handbook for Intel FPGAs

ID 785441
Date 5/08/2024
Public
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;
}