Developer Guide

Contents

Declare the
ac_int
Data Type

Perform the following steps to declare the
ac_int
data type:
  1. Include the
    ac_int.hpp
    header file as follows:
    #include <CL/sycl/INTEL/ac_types/ac_int.hpp>
  2. Declare your
    ac_int
    variables in one of the following ways:
    • 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_intN::intN var_name; //Signed N-bit integer
      ac_intN::uintN var_name; //Unsigned N-bit integer
    Where,
    N
    is the total length of the integer in bits.
    The
    ac_int
    data type has several API calls that are documented in Mentor Graphics AC Datatypes documentation, which is available at https://hlslibs.org/.
If you want to initialize an
ac_int
variable to a value larger than 64 bits, you must use the
bit_fill
or
bit_fill_hex
utility function. For details, refer to the section
Methods to Fill Bits
in the Mentor Graphics Algorithmic C (AC) Datatypes documentation available at https://hlslibs.org/.
The following code example shows the use of the
bit_fill
or
bit_fill_hex
utility functions:
typedef ac_int<80,false> i80_t; i80_t x; x.bit_fill_hex("a9876543210fedcba987"); // member funtion x = ac::bit_fill_hex<i80_t>("a9876543210fedcba987"); // global function int vec[] = { 0xa987, 0x6543210f, 0xedcba987 }; x.bit_fill(vec); // member function x = bit_fill<i80_t>(vec); // global function // inlining the constant array x.bit_fill( (int [3]) { 0xa987,0x6543210f,0xedcba987 } ); // member function x = bit_fill<i80_t>( (int [3]) { 0xa987,0x6543210f,0xedcba987 } ); // global function

Product and Performance Information

1

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