| 本文已被:浏览 4380次 下载 8938次 |
 码上扫一扫! |
|
|
| 基于OpenCL 的归约算法优化 |
|
颜深根1,2,3, 张云泉1,2, 龙国平1, 李焱1,2,3
|
|
1.中国科学院 软件研究所 并行软件与计算科学实验室,北京 100190;2.中国科学院 软件研究所 计算机科学国家重点实验室,北京 100190;3.中国科学院 研究生院,北京 100190
|
|
| 摘要: |
| 归约算法在科学计算和图像等领域有着广泛应用,系统研究了在OpenCL 框架下,归约算法在GPU 上的跨平台性能优化.已有研究工作一般只侧重单个硬件架构,基于OpenCL 从向量化、片上存储体冲突、线程组织方式和指令选择优化等多个优化角度系统考察了不同优化方法在GPU 硬件平台的影响.具体以minMax 函数为例,对每种优化方法进行了详细的性能分析,并给出了提高性能的原因.在AMD GPU 和NVIDIA GPU 平台分别测试的结果表明,优化后的算法在两个平台上都能实现很好的性能加速.在AMD ATI Radeon HD 5850 平台上,Int 和Float 类型数据带宽利用最高达到了实测带宽的89%.在NVIDIA GPU Tesla C2050 平台上,性能也达到了CUDA 版本的相应函数性能的1.3~1.9 倍. |
| 关键词: GPU 并行归约 OpenCL CUDA |
| DOI: |
| 分类号: |
| 基金项目:国家自然科学基金(60303020, 60533020); 国家高技术研究发展计划(863) (2006AA01A102); ISCAS-AMD 联合fusion 软件中心资助项目 |
|
| Reduction Algorithm Optimization Based on the OpenCL |
|
YAN Shen-Gen,ZHANG Yun-Quan,LONG Guo-Ping,LI Yan
|
|
1.Laboratory of Parallel Software and Computational Science, Institute of Software, The Chinese Academy of Sciences, Beijing 100190, China;2.State Key Laboratory of Computing Science, Institute of Software, The Chinese Academy of Sciences, Beijing 100190, Ch
|
| Abstract: |
| Reduction algorithm has a wide range of applications in areas such as scientific computing and image processing. This paper systematically studies the reduction algorithm optimization on the GPU’s cross-platform performance optimization based on the OpenCL framework. Previous research has generally focused on a single hardware architecture, however, this paper based on the OpenCL, studies various kinds of optimization methods, such as using vector, on-chip memory bank conflict, threads organization, instruction selection and so on. The research takes the minMax function for example, dilatationed each optimization method for develep the performance, and detailed the reason. The study tests the algorithm both on AMD GPU and NVIDIA GPU platforms. The test results show that the optimized algorithm on both platforms has achieved good performance. In the AMD ATI Radeon HD 5850 platform, Int and Float types of data bandwidth utilization up to 89%. In the NVIDIA GPU Tesla C2050 platform, the performance has reached 1.3 to 1.9 times compare to appropriate function version of CUDA. |
| Key words: GPU parallel reduction OpenCL CUDA |