作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2009, Vol. 35 ›› Issue (17): 274-276. doi: 10.3969/j.issn.1000-3428.2009.17.094

• 开发研究与设计技术 • 上一篇    下一篇

共轭梯度法的GPU实现

夏健明1,2,魏德敏1   

  1. (1. 华南理工大学土木工程系,广州 510640;2. 广东水利电力职业技术学院土木工程系,广州 510635)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2009-09-05 发布日期:2009-09-05

GPU Implementation of Conjugate Gradient Method

XIA Jian-ming1,2, WEI De-min1   

  1. (1. Dept. of Civil Engineering, South China University of Technology, Guangzhou 510640; 2. Dept. of Civil Engineering, Guangdong Technical College of Water Resource and Electric Engineering, Guangzhou 510635)
  • Received:1900-01-01 Revised:1900-01-01 Online:2009-09-05 Published:2009-09-05

摘要: 提出基于图形处理单元(GPU)实现矩阵与向量相乘的新算法,只需渲染四边形一次即可实现矩阵与向量乘法。并给出实现向量元素求和的新算法,与缩减算法不同,该算法不要求向量大小为2的幂。基于这2种算法使用OpenGL着色语言(GLSL)编程,用GPU实现求解线性方程组的共轭梯度法。与Krüger算法相比,该方法所用计算时间更少。

关键词: 图形处理单元, OpenGL着色语言, 共轭梯度法

Abstract: This paper presents a new algorithm for computing matrix-vector multiplication based on a Graphics Processing Unit(GPU). A matrix is presented by a texture and matrix-vector multiplication can be realized by rendering a quadrilateral one pass. Instead of vector reduction, it presents a new algorithm for summing all entries of a vector, not requiring the size of the vector be the power of two. Based on these algorithms, the conjugate gradient method for solving linear equations is implemented using the GPU with OpenGL Shading Language(GLSL). The computation is compared against that on Krüger’s algorithm, proving the efficiency of the proposed algorithms.

Key words: Graphics Processing Unit(GPU), OpenGL Shading Language(GLSL), conjugate gradient method

中图分类号: