paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Towards automatic restrictification of CUDA kernel arguments

迈向 CUDA kernel 参数的自动 restrict 标注
ASE Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering2018匹配度 4/10 · 论文是面向CUDA kernel参数restrict化的静态别名分析工具,属于传统程序分析与编译器优化,与用户核心关注的PL与LLM/Agentic交叉、浮点程序分析、贝叶斯程序分析无直接关联;仅因CUDA kernel属于机器学习系统底层而存在边缘关联。引用 1 inbox
Rokiatou Diarra
crossref: 2026-09-12

AI 速览

一句话:提出静态分析工具,在 CUDA kernel 调用点判定实参无别名后克隆 kernel,并自动为其参数添加 restrict 关键字。

C/C++ 等语言中的指针别名会阻碍编译器优化。尽管别名分析已有多年研究,其结果仍不够精确,因此 C99 引入 restrict 关键字让程序员声明非别名关系;但标注完全依赖人工,繁琐且易错,C 语言也不会检查 restrict 是否被误用。本文针对 CUDA 提出一个静态分析工具:首先定位实际参数之间不存在别名的 CUDA kernel 调用点;随后克隆这些调用点所调用的 kernel;接着在克隆体内执行别名分析,为可判定为非别名的参数加上 restrict 限定;最后在可能的情况下把原始调用替换为对优化后克隆体的调用。该工具旨在免除人工 restrict 标注,并借助编译器优化提升性能。摘要未给出实验评估数据。

问题
CUDA kernel 中的指针别名会限制编译器优化,而 restrict 关键字需程序员手工标注,工作繁琐、易出错且缺乏正确性检查。
方法
实现静态分析工具:识别实参互不别名的 CUDA kernel 调用点,克隆被调 kernel,在克隆体内做别名分析并为参数添加 restrict,最终尽可能将原调用替换为对优化克隆的调用。
评估
摘要未报告实验评估结果,仅描述工具的分析与源码变换流程,其收益以能够启用编译器优化来论证。
原文摘要(Abstract)

Many procedural languages, such as C and C++, have pointers. Pointers are powerful and convenient, but pointer aliasing still hinders compiler optimizations, despite several years of research on pointer aliasing analysis. Because alias analysis is a difficult task and results are not always accurate, the ISO C standard 99 has added a keyword, named restrict to allow the programmer to specify non−aliasing as an aid to the compiler′s optimizer and to thereby possibly improve performance. The task of annotating pointers with the restrict keyword is still left to the programmer. This task is, in general, tedious and prone to errors especially since the C does not perform any verification to ensure that restrict keyword is not misplaced. In this paper we present a static analysis tool that (i) finds CUDA kernels call sites in which actual parameters do not alias; (ii) clones the kernels called at such sites; (iii) after performing an alias analysis in these kernels, adds the restrict keyword to their arguments; and (iv) replaces the original kernel call by a call to the optimized clone whenever possible.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4724,
  title = {Towards automatic restrictification of CUDA kernel arguments},
  author = {Rokiatou Diarra},
  booktitle = {ASE},
  year = {2018},
  doi = {10.1145/3238147.3241533}
}