Debugging Intel® Array Building Blocks Programs in Microsoft* Visual Studio*


Introduction
Version
Application Notes
Prerequisites
Add the Debugger Integration
Remove the Debugger Integration
Basic Usage
Known Issues and Limitations



Introduction :

This article explains debugger integration for Intel® ArBB in a Microsoft* Visual C++* IDE. It also demonstrates the basic usage of the debugging facility.

Version :

Intel® Array Building Blocks 1.0 Beta 1 for Windows* OS

Application Notes :

The debugger integration allows programmers to inspect the content of Intel® Array Building Blocks containers using Microsoft* Visual C++* debugger. The Intel® ArBB installation process on Windows* OS does not install this feature automatically. Users have to manually add this feature following the instructions in this article.

Prerequisites :

Intel® Array Building Blocks 1.0 Beta 1 product must be installed. For information on how to get and install Intel® ArBB software on Windows* platform, refer to this KB article.

One of the following supported Microsoft* Visual C++* IDE products must be installed:

  • Microsoft* Visual C++* 2005 SP1
  • Microsoft* Visual C++* 2008
  • Microsoft* Visual C++* 2010

Add the Debugger Integration:

To enable this integration, go to start -> All Programs -> Intel® Software Development Tools -> Intel® Array Building Blocks 1.0 Beta 1, then click Add MSVC Debugger Integration, as shown in the picture below:


Add MSVC Debugger Integration


This will run a Windows* script that needs to modify a restricted area (the Program Files folder). So you may be prompted a Run As dialog box as shown below. Be sure to uncheck the system protection box before click OK. Otherwise, the installation will fail.


Uncheck System Protection Box


If the installation is successful, you will see a confirmation like this:


Intel® ArBB Debugger Installed



Remove the Debugger Integration:

To disable the integration, click Remove MSVC Debugger Integration from the same menu, as shown in the picture below:


Remove MSVC Debugger Integration


Again, you may be prompted a Run As dialog box as shown below. Be sure to uncheck the system protection box before click OK. Otherwise the uninstallation will fail.


Uncheck System Protection Box


If the uninstallation is successful, you will see a confirmation like this:


Intel® ArBB Debugger uninstalled


Basic Usage:

  • Inspecting Intel® ArBB scalar variables: Scalars can be viewed in several ways. The following examples assume "global_scalar" is an i8 type variable.
    1. The user can hold the cursor over a scalar variable until a "SmartTag" appears, as shown in this picture
      SmartTag
    2. The user can right-click on the variable and select "Quick Watch" from the pull-down menu, as shown in this picture
      QuickWatch
    3. The variable can also be displayed in the "Autos", "Locals" or "Watch" debug windows, as shown in this picture
      Autos-Locals-Watch
  • Inspecting Intel® ArBB containers: Certain high-level information (e.g. the length) of a container, as well as the individual members of the container, can be displayed. The following examples assume "g0" is an 1D dense container of i64 type, and "g2" is a 2D dense container of i64 type.

    1. Before g0 is initialized, it looks like this

      Bare dense
    2. After it has been constructed, but before it contains any data, it looks like this

      Uninitialized dense
    3. After it has been filled with data, it looks like this

      dense
    4. For a 2D or 3D dense container, the size of each dimension is shown in the "columns", "rows" or "pages" values. The individual members of the container are shown as a flat array as if the container is flattened in the row-column-page order. This may be improved in future releases. The picture below illustrates how a 2D dense container (g2) is displayed:

      2D dense
    5. A nice feature of the debugging support is that it can be used to show the AoS-to-SoA conversions that Intel® ArBB performs on the containers of structured types. The following example shows that a 1D dense container (g5) of length 32. Each of its element is a 5-field struct type. Each field is an i64 type integer. As we can expect from the AoS-to-SoA conversion, fields of the struct type are scattered into different containers. Here we see the original dense container is split into 5 containers, each containing values corresponding to one of the five fields of the original struct type.

      AoS-to-SoA
    6. It is also possible to print Intel® ArBB variables in the Visual Studio* "Command" and "Immediate" windows. However, in the case of dense containers, you have to specify a couple of member variables to get to the container level. For instance, if there is a dense container, db, containing booleans, you have to specify db.m_members.m_data to show the content of the container:

      CommandWindow


Known Issues or Limitations:

  1. The debugger can only be used to inspect Intel® ArBB scalars and containers whose elements are of built-in types, such as i32 and f64. It does not work well with containers whose elements are of user-defined types.
  2. The debugger only works for the emulation mode. That is, the Intel® ArBB optimization level must be set to O0 using the environment variable ARBB_OPT_LEVEL. Programs with big input size may run very slow or even crash in this mode.

 

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.