• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2011, Vol. 33 ›› Issue (3): 41-45.doi: 10.3969/j.issn.1007130X.2011.

• 论文 • 上一篇    下一篇

模板操作在GPU上的实现与优化

方旭东,唐玉华,王桂彬,唐滔   

  1. (国防科学技术大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2009-07-26 修回日期:2009-10-21 出版日期:2011-03-25 发布日期:2011-03-25
  • 作者简介:方旭东(1985),男,浙江诸暨人,硕士生,研究方向为计算机系统软件。方旭东(1985),男,浙江诸暨人,硕士生,研究方向为计算机系统软件。王桂彬(1981),男,博士生,研究方向为计算机系统结构。唐滔(1984),男,博士生,研究方向为计算机系统结构。
  • 基金资助:

    国家自然科学基金资助项目(60621003)

Implementation and Optimization of  Stencil Applications on GPUs

FANG Xudong,TANG Yuhua,WANG Guibin,TANG Tao   

  1. (School of Computer Science,National University of Defense Technology,Changsha 410073,China)
  • Received:2009-07-26 Revised:2009-10-21 Online:2011-03-25 Published:2011-03-25

摘要:

随着GPU的快速发展,使用GPU来加速科学计算应用已成为必然趋势。本文抽取了SPEC2000中富含模板操作的Mgrid的两个典型子程序Rprj3和Interp,使用Brook+语言把它们移植到AMD GPU上运行。采用Brook+语言提供的线程调节机制,我们实现了不同线程粒度下的程序版本,并分析了加速比不同的原因,总结了线程粒度调节对模板程序移植的指导意义。我们使用AMD Radeon HD4870 GPU作为实验平台,对比Intel Xeon E5405 CPU上的运行结果发现,在最大规模下,Rprj3获得的相对于CPU版本的加速比为5.37×, Interp获得的相对于CPU版本的加速比为12.8×。

关键词: GPU, 优化, 模板

Abstract:

With the fast development of GPUs, using them to accelerate scientific computing applications is becoming an inevitable trend. In this paper, we port two typical subroutines Rprj3 and Interp from Mgrid which contains rich stencil operations in SPEC2000 to run on an AMD GPU using Brook+. Using a thread granularity tuning mechanism provided by Brook+, we implement different ported program versions and analyze their performances. We also conclude how to utilize thread granularity tuning to optimize stencil program transplantation. Our experimental results show that under the largest problem size, Rprj3 obtains a speedup of 5.37 over its CPU version while Interp gains a speedup of 12.8 over its CPU version.

Key words: GPU;optimization;stencil