Programming Guide


Debugging the DPC++ and OpenMP* Offload Process

When writing, debugging, and optimizing code for a host platform, the process of improving your code is simple: deal with language errors when you build, catch and root-cause crashes/incorrect results during execution with a debugger, then identify and fix performance issues using a profiling tool.
Improving code can become considerably more complicated in applications where part of the execution is offloaded to another device using either DPC++ or OpenMP* offload.
  • Incorrect use of the DPC++ or OpenMP* offload languages may not be exposed until just-in-time compilation occurs when you run your program with an attached offload device (these issues can be exposed earlier with ahead-of-time (AOT) compilation).
  • Crashes due to logic errors may arise as unexpected behavior on the host, on the offload device, or in the software stack that ties the various computing devices together. To root cause these issues, you need to:
    • Debug what is happening in your code on the host using a standard debugger, such as Intel Distribution for GDB*.
    • Debug problems on the offload device using a device-specific debugger. Note, however, that the device may have a different architecture, conventions for representing compute threads, or assembly than the host.
    • To debug problems that show up in the intermediate software stack only when kernels and data are being exchanged with the device, you need to monitor the communication between device and host and any errors that are reported during the process.
  • Besides the usual performance issues that can occur on the host and offload devices, the patterns by which the host and offload device work together can have a profound impact on application performance. This is another case where you need to monitor the communications between the host and offload device.
This section discusses the various debugging and performance analysis tools and techniques available to you for the entire lifecycle of the offload program.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at