Affiliation:
1. Cornell University, USA
2. Google, USA
3. Microsoft Research, USA
Abstract
Heterogeneous hardware is central to modern advances in performance and efficiency. Mainstream programming models for heterogeneous architectures, however, sacrifice safety and expressiveness in favor of low-level control over performance details. The interfaces between hardware units consist of verbose, unsafe APIs; hardware-specific languages make it difficult to move code between units; and brittle preprocessor macros complicate the task of specializing general code for efficient accelerated execution. We propose a unified low-level programming model for heterogeneous systems that offers control over performance, safe communication constructs, cross-device code portability, and hygienic metaprogramming for specialization. The language extends constructs from multi-stage programming to separate code for different hardware units, to communicate between them, and to express compile-time code optimization. We introduce static staging, a different take on multi-stage programming that lets the compiler generate all code and communication constructs ahead of time.
To demonstrate our approach, we use static staging to implement BraidGL, a real-time graphics programming language for CPU-GPU systems. Current real-time graphics software in OpenGL uses stringly-typed APIs for communication and unsafe preprocessing to generate specialized GPU code variants. In BraidGL, programmers instead write hybrid CPU-GPU software in a unified language. The compiler statically generates target-specific code and guarantees safe communication between the CPU and the graphics pipeline stages. Example scenes demonstrate the language's productivity advantages: BraidGL eliminates the safety and expressiveness pitfalls of OpenGL and makes common specialization techniques easy to apply. The case study demonstrates how static staging can express core placement and specialization in general heterogeneous programming.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference83 articles.
1. Advanced Micro Devices. Mantle Programming Guide and API Reference 1.0. https://www.amd.com/Documents/ Mantle- Programming- Guide- and- API- Reference.pdf . Advanced Micro Devices. Mantle Programming Guide and API Reference 1.0. https://www.amd.com/Documents/ Mantle- Programming- Guide- and- API- Reference.pdf .
2. PetaBricks
3. Apple. Metal Shading Language Specification Version 2.0. https://developer.apple.com/metal/ Metal- Shading- Language- Specification.pdf . Apple. Metal Shading Language Specification Version 2.0. https://developer.apple.com/metal/ Metal- Shading- Language- Specification.pdf .
4. Lime
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Supporting Unified Shader Specialization by Co-opting C++ Features;Proceedings of the ACM on Computer Graphics and Interactive Techniques;2022-07-25
2. Optimum Scheduling and Routing of Material Through Computational Techniques;Lecture Notes in Mechanical Engineering;2022-07-24
3. Multi-stage programming in the large with staged classes;Proceedings of the 19th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2020-11-16
4. Fluid quotes: metaprogramming across abstraction boundaries with dependent types;Proceedings of the 19th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2020-11-15
5. Staged metaprogramming for shader system development;ACM Transactions on Graphics;2019-12-31