Efficient parallelization of algorithms on general-purpose GPUs is today essential in many areas. However, it is a non-trivial task for software engineers to utilize GPUs to improve the performance of high-level programs in general. Although many domain-specific approaches are available for GPU acceleration, it is difficult to accelerate existing high-level programs without rewriting parts of the programs using low-level GPU code. In this paper, we propose a different approach, where expressions are marked for acceleration, and the compiler automatically infers which code needs to be accelerated. We call this approach expression acceleration. We design a compiler pipeline for the approach and show how to handle several challenges, including expression extraction, well-formedness, and compiling using multiple backends. The approach is designed and implemented within a statically-typed functional intermediate language and evaluated using three distinct non-trivial case studies.
翻译:将通用 GPU 的算法有效平行化在当今许多领域至关重要。 但是,对于软件工程师来说,使用 GPU 来提高高级程序的总体性能是一项非三重任务。 虽然在 GPU 加速方面有许多特定领域的方法,但如果不使用低级 GPU 代码重写部分程序,就很难加快现有的高级程序。 在本文中,我们建议了一种不同的方法,即表达方式要加速,而编纂者则自动推断需要加速编码。 我们称之为这个方法的表达方式加速。 我们设计了一个编译器管道,展示如何应对多种挑战,包括表达提取、完善和用多个后端进行汇编。 这种方法是在静态型功能中间语言中设计和实施的,并使用三种不同的非三重案例研究进行评估。