Providing Source Code Level Portability Between CPU and GPU with MapCG

Providing Source Code Level Portability Between CPU and GPU with MapCG
复制标题

使用 MapCG 在 CPU 和 GPU 之间提供源代码级可移植性

DOI:
10.1007/s11390-012-1205-4
复制
发表时间:
2012
影响因子:
1.9
通讯作者:
Haibo Lin
Haibo Lin
中科院分区:
计算机科学3区
文献类型:
--
作者:
Chuntao Hong;Dehao Chen;Yu;Wenguang Chen;Weimin Zheng;Haibo Lin

文献摘要

被引文献

相似文献

近年来,图形处理单元(GPU)在通用计算市场中扮演着重要的角色。目前,对GPU单元进行编程的常见方法是使用低级GPU API(如CUDA)编写特定于GPU的代码。尽管这种方法可以获得良好的性能,但它会带来严重的可移植性问题,因为程序员需要为每个潜在的目标体系结构编写特定版本的代码。这导致了高昂的开发和维护成本。我们认为,希望有一种能够在CPU和GPU以及不同的GPU之间提供源代码可移植性的编程模型。这将允许程序员编写一个版本的代码,无需修改即可在CPU或GPU上高效编译和执行。在本文中,我们提出了MapCG,这是一个提供源代码级CPU和GPU之间可移植性的MapReduce框架。与OpenCL等其他方法相比,我们的框架基于MapReduce,提供了一个高层次的编程模型,使编程变得更加容易。我们描述了MapCG的设计,包括MapReduce式的高级编程框架和在CPU和GPU上的运行系统。实现了一个支持多核CPU和NVIDIA图形处理器的MapCG运行时原型。我们的实验结果表明,该实现可以在多核处理器平台和GPU上高效地执行相同的源代码,在8个常用应用程序上实现的平均加速比为1.6 ~ 2.5倍。
Graphics processing units (GPU) have taken an important role in the general purpose computing market in recent years. At present, the common approach to programming GPU units is to write GPU specific code with low level GPU APIs such as CUDA. Although this approach can achieve good performance, it creates serious portability issues as programmers are required to write a specific version of the code for each potential target architecture. This results in high development and maintenance costs. We believe it is desirable to have a programming model which provides source code portability between CPUs and GPUs, as well as different GPUs. This would allow programmers to write one version of the code, which can be compiled and executed on either CPUs or GPUs efficiently without modification. In this paper, we propose MapCG, a MapReduce framework to provide source code level portability between CPUs and GPUs. In contrast to other approaches such as OpenCL, our framework, based on MapReduce, provides a high level programming model and makes programming much easier. We describe the design of MapCG, including the MapReduce-style high-level programming framework and the runtime system on the CPU and GPU. A prototype of the MapCG runtime, supporting multi-core CPUs and NVIDIA GPUs, was implemented. Our experimental results show that this implementation can execute the same source code efficiently on multi-core CPU platforms and GPUs, achieving an average speedup of 1.6 ~ 2.5x over previous implementations of MapReduce on eight commonly used applications.