30808

Source-to-Source Transformations for GPU Code Generation

Julien de Castelnau, Thomas Koehler, Arthur Charguéraud, Clément Pit-Claudel
École Polytechnique Fédérale de Lausanne
arXiv:2605.13864 [cs.PL], (30 Apr 2026)

@misc{castelnau2026sourcetosource,

   title={Source-to-Source Transformations for GPU Code Generation},

   author={Julien de Castelnau and Thomas Koehler and Arthur Charguéraud and Clément Pit-Claudel},

   year={2026},

   eprint={2605.13864},

   archivePrefix={arXiv},

   primaryClass={cs.PL},

   url={https://arxiv.org/abs/2605.13864}

}

Download Download (PDF)   View View   Source Source   

313

views

GPUs have become essential in modern high performance computing, but programming them correctly remains a significant challenge. This difficulty arises from subtle concurrency bugs that result from the explicit management of synchronization primitives and data movement across intricate hierarchies of memory and parallel threads. At the same time, the ability to control these aspects explicitly is at the core of the performance gains granted by GPUs. These challenges have motivated interest in safe GPU programming: tools and languages that can prevent or detect such bugs statically. However, existing approaches make tradeoffs in three dimensions: the strength of their guarantees, the degree of low-level control they allow, and the amount of additional effort required to achieve these safety guarantees. This thesis presents OptiGPU, a system for GPU programming with strong safety guarantees-data race freedom, deadlock freedom, and full functional correctness-that minimizes tradeoffs in the other two dimensions compared to previous approaches. OptiGPU applies proof-preserving compilation to GPU programming, allowing verification of low-level, optimized GPU programs through refinement of simple, verified CPU programs. An OptiGPU user thus avoids the substantial proof burden of directly verifying complex optimized GPU programs, instead directing this refinement with source-to-source transformations that automatically preserve proofs. OptiGPU is implemented as a set of extensions to OptiTrust, an existing framework for proof-preserving compilation on CPUs. OptiGPU models essential GPU programming features, including kernel launches, shared memory, and synchronous barriers, and produces both device and host-side code. We evaluate OptiGPU on two case studies, matrix transpose and tree-based parallel reduction, showing it can derive CUDA code matching techniques found in handwritten references.
No votes yet.
Please wait...

You must be logged in to post a comment.

Recent source codes

* * *

* * *

HGPU group © 2010-2026 hgpu.org

All rights belong to the respective authors

Contact us: