Developer Guide

Contents

Algorithmic C Data Types

The following table summarizes the algorithmic C (AC) data types:
Algorithmic C Data Types Supported by the
Intel® oneAPI
DPC++/C++
Compiler
Data Type
Header File
Variable Declaration
Description
ac_int
<sycl/ext/intel/ac_types/ac_int.hpp>
  • Template-based declaration:
    ac_int<
    N
    , true> var_name; //Signed N-bit integer
    ac_int<
    N
    , false> var_name; //Unsigned N-bit integer
  • Predefined types up to 63 bits:
    ac_int
    N
    ::int
    N
    var_name; //Signed N-bit integer
    ac_int
    N
    ::uint
    N
    var_name; //Unsigned N-bit integer
Arbitrary-precision integer support
ac_fixed
<sycl/ext/intel/ac_types/ac_fixed.hpp>
ac_fixed<
N
,
I
, true,
Q
,
O
> var_name; //Signed fixed-point number
ac_fixed<
N
,
I
, false,
Q
,
O
> var_name; //Unsigned fixed-point number
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

Compilation Flags for Data Types
Data Type
dpcpp
Command Flags
Description
AC type
  • Linux
    :
    -qactypes
  • Windows
    :
    /Qactypes
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.
ap_float
type
  • Linux
    :
    -fp-model=precise -no-fma
  • Windows
    :
    /fp:precise /Qfma-
Use these flags to ensure that floating-point operations are accurate.
-DFPGA_EMULATOR
Compiles programs with
ap_float
data type for emulation.

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:
Math Functions Provided by
ap_float_math.hpp
Header File
Function Type
Math Functions
Comment
Exponential and logarithmic functions
  • ln
  • log
    2
    ,
    log
    10
  • e
    x
    ,
    2
    x
    ,
    10
    x
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.
  • ln(1+x)
  • e
    x
    −1
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
  • reciprocal
  • reciprocal_sqrt
  • sqrt
  • cube root
  • hypot
    (hypotenuse)
Power functions
  • pow
  • powr
  • pown
Trigonometric functions
  • sin
    ,
    cos
    ,
    sincos
  • sinpi
    ,
    cospi
  • asin
    ,
    asinpi
  • acos
    ,
    acospit
  • atan
    ,
    atanpi
    ,
    atan2

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.