用StarPU进行混合CPU/GPU编程的C语言扩展
C Language Extensions for Hybrid CPU/GPU Programming with StarPU
摘要:
用于高性能计算(HPC)的现代平台包括具有通用CPU和“加速器”(通常以图形处理单元(GPU)的形式)的机器。StarPU是一个利用此类平台的C库。它为用户提供了定义要在CPU或GPU上执行的“任务”的方法,以及它们之间的依赖关系,并通过在所有可用的处理单元上自动调度它们。这样,它还使程序员不必了解底层架构细节:它可以适应可用的CPU和GPU,并根据需要自动在主内存和GPU之间传输数据。虽然StarPU的方法成功地解决了运行时调度问题,但作为一个C库,它的编程接口很差,而且容易出错。本文介绍了2011年开始的一项努力,通过扩展GCC编译器套件,将库导出的一些概念作为C语言结构进行推广。我们的主要贡献是映射到StarPU的任务编程范式的语言扩展的设计和实现。我们认为,所提出的扩展使StarPU更容易入门,消除了使用C库时可能发生的错误,并帮助诊断可能的错误。我们就今后的工作作出结论。
英文摘要:
Modern platforms used for high-performance computing (HPC) include machines with both general-purpose CPUs, and "accelerators", often in the form of graphical processing units (GPUs). StarPU is a C library to exploit such platforms. It provides users with ways to define "tasks" to be executed on CPUs or GPUs, along with the dependencies among them, and by automatically scheduling them over all the available processing units. In doing so, it also relieves programmers from the need to know the underlying architecture details: it adapts to the available CPUs and GPUs, and automatically transfers data between main memory and GPUs as needed. While StarPU's approach is successful at addressing run-time scheduling issues, being a C library makes for a poor and error-prone programming interface. This paper presents an effort started in 2011 to promote some of the concepts exported by the library as C language constructs, by means of an extension of the GCC compiler suite. Our main contribution is the design and implementation of language extensions that map to StarPU's task programming paradigm. We argue that the proposed extensions make it easier to get started with StarPU,eliminate errors that can occur when using the C library, and help diagnose possible mistakes. We conclude on future work.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。