Developer Guide
Intel® oneAPI DPC++/C++ Compiler Handbook for FPGAs
A newer version of this document is available. Customers should click here to go to the newest version.
Algorithmic C Data Types
The following table summarizes the algorithmic C (AC) data types:
| Data Type | Header File | Variable Declaration | Description |
|---|---|---|---|
| ac_int | <sycl/ext/intel/ac_types/ac_int.hpp> |
|
Arbitrary-precision integer support |
| ac_fixed | <sycl/ext/intel/ac_types/ac_fixed.hpp> | ac_fixed<W, I, S, Q, O> var_name; For a description of the template parameters, refer to Declare the ac_fixed Data Type. |
Arbitrary-precision fixed-point number support. For math functions supported by this data type, refer to Math Functions Provided by the ac_fixed_math.hpp Header File. |
| ac_complex | <sycl/ext/intel/ac_types/ac_complex.hpp> | Declare according to the data type of your complex number. | Complex number support |
| ap_float | <sycl/ext/intel/ac_types/ap_float.hpp> | ihc::ap_float<exponent_width, mantissa_width[,rounding_mode]> | Arbitrary-precision floating-point number support. For math functions supported by this data type, refer to Math Functions Provided by ap_float_math.hpp Header File |
Compilation Flags
| AC Data Type | SYCL Command Flags | Description |
|---|---|---|
| Any |
|
Use these flags to include ac_types header files on the include path and link against AC type libraries required for the host device execution support. |
| -DFPGA_EMULATOR | Compiles programs with an AC data type for emulation. | |
| ap_float |
|
Use these flags to ensure that floating-point operations are accurate. |
Explicit Conversion Functions
The following table lists the functions to convert to C signed and unsigned integer types int, long and Slong for the ac_int and ac_fixed data types:
| AC Data Type | Supported Conversion Functions |
|---|---|
| ac_int | to_int(), to_uint(), to_long(), to_ulong(), to_int64(), to_uint64(), to_double() |
| ac_fixed | to_int(), to_uint(), to_long(), to_ulong(), to_int64(), to_uint64(), to_double(), to_float() , to_ac_int() |
Math Functions Provided by the ac_fixed_math.hpp Header File
The ac_fixed_math.hpp header file adds support for the following non-standard math functions for the arbitrary precision fixed-point (ac_fixed) data type:
- sqrt_fixed
- reciprocal_fixed
- reciprocal_sqrt_fixed
- sin_fixed
- cos_fixed
- sincos_fixed
- sinpi_fixed
- cospi_fixed
- sincospi_fixed
- log_fixed
- exp_fixed
Math Functions Provided by ap_float_math.hpp Header File
The ap_float_math.hpp header file adds support for the following arbitrary precision fixed-point (ap_float) data type functions:
| Function Type | Math Functions | Comment |
|---|---|---|
| Exponential and logarithmic functions |
|
Supported only for ap_float data types with exponent width less than or equal to 15 bits and mantissa width less than or equal to 63 bits. |
|
Supported only for ap_float data types with exponent width less than or equal to 11 bits and mantissa width less than or equal to 52 bits. | |
| Advanced functions |
|
|
| Power functions |
|
|
| Trigonometric functions |
|