Modular GPU Programming with Typed Perspectives
Open Access
- 8 June 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 10 (PLDI) , 1077-1101
Abstract
To achieve peak performance on modern GPUs, one must balance two frames of mind: issuing instructions to individual threads to control their behavior, while simultaneously tracking the convergence of many threads acting in concert to perform collective operations like Tensor Core instructions. The tension between these two mindsets makes modular programming error prone. Functions that encapsulate collective operations, despite being called per-thread, must be executed cooperatively by groups of threads. In this work, we introduce Prism, a new GPU language that restores modularity while still giving programmers the low-level control over collective operations necessary for high performance. Our core idea is typed perspectives, which materialize, at the type level, the granularity at which the programmer is controlling the behavior of threads. We describe the design of Prism, implement a compiler for it, and lay its theoretical foundations in a core calculus called Bundl. We implement state-of-the-art GPU kernels in Prism and find that it offers programmers the safety guarantees needed to confidently write modular code without sacrificing performance.Keywords
All Related Versions
Funding Information
- Defense Advanced Research Projects Agency (HR001125CE038)
- Defense Advanced Research Projects Agency (HR001123C0139)
- National Science Foundation (CCF-221706)
This publication has 23 references indexed in Scilit:
- Futhark: purely functional GPU-programming with nested parallelism and in-place array updates2017
- A Hoare Logic for GPU KernelsACM Transactions on Computational Logic, 2017
- Proving Liveness of Parameterized Programs2016
- SingeACM SIGPLAN Notices, 2014
- HalideACM SIGPLAN Notices, 2013
- The tasks with effects model for safe concurrency2013
- Logical relations for fine-grained concurrency2013
- Accelerating Haskell array codes with multicore GPUs2011
- A type and effect system for deterministic parallel Java2009
- A core calculus of dependency1999