Visible to Intel only — GUID: GUID-D79265A4-2F14-4DB5-8C03-D385622586EF
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 after just-in-time compilation occurs. 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.
To troubleshoot your applications that use OpenMP* or the SYCL* API with extensions to offload resources, see the Troubleshoot Highly Parallel Applications tutorial.