Résumé
Rewriting code for cleanliness, API changes, and new programming models is a common, yet time-consuming task. Localized or syntax-based changes are often mechanical and can be automated with text-based rewriting tools, like sed. However, non-localized or semantic-based changes require specialized tools that usually come with complex, hard-coded rules that require expertise in compilers. This means techniques for source rewriting are either too simple for complex tasks or too complex to be customized by non-expert users; in either case, developers are often forced to manually update their code instead. This work describes a new approach to code rewriting which exposes complex and semantic-driven rewrite capabilities to users in a simple and natural way. Rewrite rules are expressed as a pair of parameterized “before-and-after” source code snippets, one to describe what to match and one to describe what the replacement looks like. Through this novel and user-friendly interface, programmers can automate and customize complex code changes which require a deep understanding of the language without any knowledge of compiler internals. As our prototype, MARTINI, is built on top of Clang, we can (conceptually) handle all Clang’s input languages, including CUDA, SYCL, and many other C/C++-based interfaces, like Kokkos and OpenMP. To showcase usability, we implemented the clang-tidy rule “modernize-use-nullptr” and a simple instrumentation example. To further illustrate the potential of MARTINI, we reimplemented HIPIFY, which translates CUDA to HIP. Compared to hipify-perl and hipify-clang from HIPIFY, our version is easier to implement, more understandable, and customizable. The latter allows us to outperform HIPIFY-generated code by slightly modifying the translation rules of MARTINI-HIPIFY.
| langue originale | Anglais |
|---|---|
| titre | Euro-Par 2022 |
| Sous-titre | Parallel Processing - 28th International Conference on Parallel and Distributed Computing, Proceedings |
| rédacteurs en chef | José Cano, Phil Trinder |
| Editeur | Springer Science and Business Media Deutschland GmbH |
| Pages | 19-34 |
| Nombre de pages | 16 |
| ISBN (imprimé) | 9783031125966 |
| Les DOIs | |
| état | Publié - 2022 |
| Modification externe | Oui |
| Evénement | 28th International European Conference on Parallel and Distributed Computing, Euro-Par 2022 - Glasgow, Royaume-Uni Durée: 22 août 2022 → 26 août 2022 |
Série de publications
| Nom | Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) |
|---|---|
| Volume | 13440 LNCS |
| ISSN (imprimé) | 0302-9743 |
| ISSN (Electronique) | 1611-3349 |
Conférence
| Conférence | 28th International European Conference on Parallel and Distributed Computing, Euro-Par 2022 |
|---|---|
| Pays/Territoire | Royaume-Uni |
| La ville | Glasgow |
| période | 22/08/22 → 26/08/22 |
Empreinte digitale
Voici les principaux termes ou expressions associés à « MARTINI: The Little Match and Replace Tool for Automatic Application Rewriting with Code Examples ». Ces libellés thématiques sont générés à partir du titre et du résumé de la publication. Ensemble, ils forment une empreinte digitale unique.Ensembles de données
-
Artifact Instructions for MARTINI: The Little Match and Replace Tool
Johnson, A. (Créateur), Coti, C. (Créateur), Malony, A. (Créateur) & Doerfert, J. (Créateur), figshare, 2022
DOI: 10.6084/m9.figshare.19993454
Ensemble de données
Contient cette citation
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver