This paper presents the first formal analysis of the official memory consistency model for the NVIDIA PTX virtual ISA. Like other GPU memory models, the PTX memory model is weakly ordered but provides scoped synchronization primitives that enable GPU program threads to communicate through memory. However, unlike some competing GPU memory models, PTX does not require data race freedom, and this results in PTX using a fundamentally different (and more complicated) set of rules in its memory model. As such, PTX has a clear need for a rigorous and reliable memory model testing and analysis infrastructure. We break our formal analysis of the PTX memory model into multiple steps that collectively demonstrate its rigor and validity. First, we adapt the English language specification from the public PTX documentation into a formal axiomatic model. Second, we derive an up-to-date presentation of an OpenCL-like scoped C++ model and develop a mapping from the synchronization primitives of that scoped C++ model onto PTX. Third, we use the Alloy relational modeling tool to empirically test the correctness of the mapping. Finally, we compile the model and mapping into Coq and build a full machine-checked proof that the mapping is sound for programs of any size. Our analysis demonstrates that in spite of issues in previous generations, the new NVIDIA PTX memory model is suitable as a sound compilation target for GPU programming languages such as CUDA. CCS Concepts • Hardware → Theorem proving and SAT solving; • Software and its engineering → Consistency.
Repeated changes to a software system can introduce small weaknesses such as unplanned dependencies between different parts of the system. While such problems usually go undetected, their cumulative effect can result in a noticeable decrease in the quality of a system. We present an approach to warn developers about increased coupling between the (potentially scattered) implementation of different features. Our automated approach can detect sections of the source code contributing to the increased coupling as soon as software changes are tested. Developers can then inspect the results to assess whether the quality of their changes is adequate.We have implemented our approach for C++ and integrated it with the development process of proprietary 3D graphics software. Our field study showed that, for files in the target system, causing increases in feature coupling is a significant predictor of future modifications due to bug fixes.ii RÉSUMÉ Chaque modification appliquée à un système logiciel peut y introduire de nouvelles failles telles que des dépendances structurelles entre ses éléments unitaires. Il peut être difficile de percevoir ce processus de dégradation de la qualité puisque qu'il n'implique pas nécessairement une dégradation fonctionnelle. Nous présentons ici une nouvelle technique permettant à l'ingénieur logiciel de comprendre l'impact de ses modifications sur les dépendances structurelles dans le contexte des fonctionnalités du système. Notre approche automatisée identifie les éléments logiciels ainsi potentiellement dégradés dès que le logiciel est soumis à sa procédure de vérification habituelle.L'ingénieur peut alors inspecter les résultats de notre analyse pour déterminer si la qualité de la modification appliquée est adéquate.Nous avons déployés notre système dans un environnement logiciel graphique 3D privé sous C++. Notre étude démontre que, pour ce système, l'addition de dépendances structurelles est un précurseur de modifications rectificatrices dans le futur.iii ACKNOWLEDGEMENTS
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.