Developer Guide

Contents

Declare the
ac_fixed
Data Type

Perform the following steps to declare the
ac_fixed
data type:
  1. Include the
    ac_fixed.hpp
    header file as follows:
    #include <CL/sycl/INTEL/ac_types/ac_fixed.hpp>
  2. Declare your
    ac_fixed
    variables as follows:
    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
    The following table describes the template parameters:
    Template Parameter
    Description
    N
    The total length of the fixed-point number in bits.
    I
    The number of bits used to represent the integer value of the fixed-point number. The difference of
    N−I
    determines how many bits represent the fractional part of the fixed-point number.
    Q
    The quantization mode that determines how to handle values where the generated precision (number of decimal places) exceeds the number of bits available in the variable to represent the fractional part of the number.
    For a list of quantization modes and their descriptions, refer to the
    Quantization and Overflow
    section in the Mentor Graphics Algorithmic C (AC) Datatypes documentation, which is available at https://hlslibs.org/.
    O
    The overflow mode that determines how to handle values where the generated value has more bits than the number of bits available in the variable. For a list of overflow modes and their descriptions, refer to the
    Quantization and Overflow
    section in the Mentor Graphics Algorithmic C (AC) Datatypes documentation, which is available at https://hlslibs.org/.
For a list of supported operators and their return types, refer to the
Arbitrary-Length Bit-Accurate Integer and Fixed-Point Datatypes
chapter in the Mentor Graphics Algorithmic C (AC) Datatypes documentation, which is available at https://hlslibs.org/.

Math Functions Provided by the
ac_fixed_math.hpp
Header File

Include the header file as follows:
#include <CL/sycl/INTEL/ac_types/ac_fixed_math.hpp>
The
ac_fixed_math.hpp
header file provides support for the following arbitrary precision fixed-point (
ac_fixed
) data type functions:
  • sqrt_fixed
  • reciprocal_fixed
  • reciprocal_sqrt_fixed
  • sin_fixed
  • cos_fixed
  • sincos_fixed
  • sinpi_fixed
  • cospi_fixed
  • sincospi_fixed
  • log_fixed
  • exp_fixed
For details about input type restrictions, input value limits, and output type propagation rules, review the comments in the
ac_fixed_math.hpp
header file.
Due to the differences in the internal math implementations, the results from the
ac_fixed
data type operations might differ between simulation (not supported yet) and emulation. The maximum difference is within a few units in the last place (ULPs).

Product and Performance Information

1

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