Debugging OpenACC Codes with Arm DDT
OpenACC is a directive-based programming model that enables offloading code from C, C++, and Fortran to attached accelerators. The OpenACC model uses an architecture and syntax similar to OpenMP which frees the developer from the need to initialize the accelerator or manage data transfer. For GPUs in particular, the model provides a framework that greatly simplifies porting or creating programs to use GPU accelerators.
Even with simplified development models there will always be difficult bugs. Fortunately, Arm DDT enables developers to debug OpenACC codes with the same ease as CPU only codes. Some of the tasks you can perform with DDT include stepping though accelerator code, setting breakpoints, and using the multi-dimensional array viewer to inspect data on the device.
This tutorial shows how to modify a simple matrix multiplication function to use a GPU with OpenACC, and how to use Arm DDT to inspect this code.