Tiago Santos
Tiago Santos received the M.Sc. degree in Informatics and Computer Engineering from the University of Porto, Portugal, in 2020, where he is currently finishing a Ph.D. degree in Informatics Engineering. His current interests include CPU/FPGA heterogeneous computing, high-level synthesis and compilation techniques.
Session
Critical performance regions of applications are often improved by offloading them onto specialized accelerators. This process requires selecting an adequate region of the program, subject to any eventual data dependencies, communication overheads, and the nature of the computations done in that region. Due to the complexity of this problem and the high variability of downstream vendor tools, an automated approach to this problem invites the use of a source-to-source compiler as the first stage of the compilation pipeline, preserving the source code's readability and retargetability. To this end, we propose using the Clava C/C++ source-to-source compiler to take in any C or C++ application, find and optimize adequate regions for offloading, and output those regions as separate translation units. By leveraging Clang's Abstract Syntax Tree (AST), Clava allows for a developer to write highly composable extensions that perform analysis and transformations over that AST, using modern scripting languages such as JavaScript and TypeScript. We demonstrate an entire source-to-source compilation flow for accelerating a C/C++ application, including extensions ranging from source code transformations such as function outlining and struct flattening; generation of a task graph representation of any C/C++ application; and selecting and extracting code regions for different types of accelerators, including the automatic generation of the communication layer using different APIs.