Affiliation:
1. University of Kent, UK
2. Imperial College London, UK
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.
Funder
Engineering and Physical Sciences Research Council
Seventh Framework Programme
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference44 articles.
1. Fences in Weak Memory Models
2. Herding Cats
3. GPU Concurrency
4. AMD Developer Central. AMD APP SDK 3.0 released featuring OpenCL 2.0 2015. URL http: //developer.amd.com/community/blog/2015/08/ 26/introducing-app-sdk-30-opencl-2/. AMD Developer Central. AMD APP SDK 3.0 released featuring OpenCL 2.0 2015. URL http: //developer.amd.com/community/blog/2015/08/ 26/introducing-app-sdk-30-opencl-2/.
5. Warps and Atomics: Beyond Barrier Synchronization in the Verification of GPU Kernels
Cited by
37 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Compiler Testing with Relaxed Memory Models;2024 IEEE/ACM International Symposium on Code Generation and Optimization (CGO);2024-03-02
2. Static Analysis of Memory Models for SMT Encodings;Proceedings of the ACM on Programming Languages;2023-10-16
3. Optimal Reads-From Consistency Checking for C11-Style Memory Models;Proceedings of the ACM on Programming Languages;2023-06-06
4. Probabilistic Concurrency Testing for Weak Memory Programs;Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2;2023-01-27
5. MC Mutants: Evaluating and Improving Testing for Memory Consistency Specifications;Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2;2023-01-27