Overhauling SC atomics in C11 and OpenCL
File(s)POPL.pdf (474.13 KB) openclmm.pdf (474.62 KB)
Accepted version
Accepted version
Author(s)
Batty, M
Donaldson, AF
Wickerson, JP
Type
Conference Paper
Abstract
Despite the conceptual simplicity of sequential consistency (SC), the semantics of SC atomic operations and fences in the C11 and OpenCL memory models is subtle, leading to convoluted prose descriptions that translate to complex axiomatic formalisations. We conduct an overhaul of SC atomics in C11, reducing the associated axioms in both number and complexity. A consequence of our simplification is that the SC operations in an execution no longer need to be totally ordered. This relaxation enables, for the first time, efficient and exhaustive simulation of litmus tests that use SC atomics. We extend our improved C11 model to obtain the first rigorous memory model formalisation for OpenCL (which extends C11 with support for heterogeneous many-core programming). In the OpenCL setting, we refine the SC axioms still further to give a sensible semantics to SC operations that employ a ‘memory scope’ to restrict their visibility to specific threads. Our overhaul requires slight strengthenings of both the C11 and the OpenCL memory models, causing some behaviours to become disallowed. We argue that these strengthenings are natural, and that all of the formalised C11 and OpenCL compilation schemes of which we are aware (Power and x86 CPUs for C11, AMD GPUs for OpenCL) remain valid in our revised models. Using the HERD memory model simulator, we show that our overhaul leads to an exponential improvement in simulation time for C11 litmus tests compared with the original model, making *exhaustive* simulation competitive, time-wise, with the *non-exhaustive* CDSChecker tool.
Date Issued
2016-01-11
Date Acceptance
2015-10-05
Citation
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2016, 51 (1), pp.634-648
ISBN
9781450335492
ISSN
0730-8566
Publisher
ACM
Start Page
634
End Page
648
Journal / Book Title
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
Volume
51
Issue
1
Copyright Statement
© ACM, 2016. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in ACM SIGPLAN Notices - POPL '16, {VOL# 51, ISS# 1, (11 Jan 2016)} https://dx.doi.org/10.1145/2837614.2837637
Sponsor
Commission of the European Communities
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Grant Number
287767
EP/K011499/1
EP/I020357/1
EP/K015168/1
Source
ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL)
Subjects
Science & Technology
Technology
Computer Science, Software Engineering
Computer Science
Formal methods
graphics processing unit (GPU)
heterogeneous programming
HOL theorem prover
language design
program simulation
weak memory models
cs.PL
cs.PL
D.3.1; D.3.3; F.3.2
Software Engineering
Publication Status
Published
Start Date
2016-01-20
Finish Date
2016-01-23
Coverage Spatial
St Petersburg, FL, USA