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
摘要: 提出基于图形处理单元(GPU)实现矩阵与向量相乘的新算法,只需渲染四边形一次即可实现矩阵与向量乘法。并给出实现向量元素求和的新算法,与缩减算法不同,该算法不要求向量大小为2的幂。基于这2种算法使用OpenGL着色语言(GLSL)编程,用GPU实现求解线性方程组的共轭梯度法。与Krüger算法相比,该方法所用计算时间更少。
关键词:
图形处理单元,
OpenGL着色语言,
共轭梯度法
CLC Number:
XIA Jian-ming; WEI De-min. GPU Implementation of Conjugate Gradient Method[J]. Computer Engineering, 2009, 35(17): 274-276.
夏健明;魏德敏. 共轭梯度法的GPU实现[J]. 计算机工程, 2009, 35(17): 274-276.