计算机时代
基于GPU—CUDA的共轭斜量法实现及性能对比
2013年06期作者◎彭土有
 

摘 要: 偏微分方程数值解法(包括有限差分法、有限元法)以及大量的数学物理方程数值解法最终都会演变成求解大型线性方程组。因此,探讨快速、稳定、精确的大型线性方程组解法一直是数值计算领域不断深入研究的课题且具有特别重要的意义。在迭代法中,共轭斜量法(又称共轭梯度法)被公认为最好的方法之一。但是,该方法最大缺点是仅适用于线性方程组系数矩阵为对称正定矩阵的情况,而且常规的CPU算法实现非常耗时。为此,通过将线性方程组系数矩阵作转换成对称矩阵后实施基于GPU-CUDA的快速共轭斜量法来解决一般性大型线性方程组的求解问题。试验结果表明:在求解效率方面,基于GPU-CUDA的共轭斜量法运行效率高,当线性方程组阶数超过3000时,其加速比将超过14;在解的精确性与求解过程的稳定性方面,与高斯列主元消去法相当。基于GPU-CUDA的快速共轭斜量法是求解一般性大型线性方程组快速而非常有效的方法。

关键词: GPU; CUDA; 大型线性方程组; 共轭斜量法; 算法; 并行计算

中图分类号:TP311.1 文献标志码:A 文章编号:1006-8228(2014)04-04-03

Abstract: The numerical solution for partial differential equations (including finite difference method, and finite element method) and a large number of equations of mathematical physics problems will eventually evolve into solving a large-scale linear equation system. Therefore, studying fast, stable and accurate solutions for large-scale linear equation systems has been a hot topic in the field of numerical calculation for years, which has special significance. Among iterative methods, conjugate gradient method is recognized as one of the best methods. However, this method is only applicable to linear equation systems in which coefficient matrix is symmetric and positive definite. Besides, in conventional CPU implementation, the method for solving a large-scale linear equation system is time-consuming. After the linear equations coefficient matrix A is converted into a symmetric matrix by, the fast conjugate gradient method based on GPU-CUDA is implemented to solve a general large-scale linear equation system. The results show that it is highly efficient. When the rank of the coefficient matrix is over 3000, the speedup will be over 14 times. Besides, it has the same accuracy and stability as Gaussian elimination method. The conjugate gradient method based on GPU-CUDA becomes a fast and effective method for solving large-scale general linear equation systems.

Key words: GPU; CUDA; large-scale linear equation system; conjugate gradient method; algorithm; parallel computation

0 引言

偏微分方程数值解法(包括有限差分法、有限元法)及大量的数学物理方程数值解法最终都将演变成求解大型线性方程组[4,7]。(剩余3071字)

《党建》手机网向会员提供党组织中心组必读文章。您需要拥有会员权限才可以享受此服务。
会员登录