# Sparse generalized eigensolver using OpenCL

I would like to solve a generalized eigenproblem of real sparse symmetric matrices. Is there an efficient library which utilizes OpenCL in order to find a limited amount of the smallest eigenvalues in magnitude?

One possibility is to use a combination of ARPACK and ViennaCL:

• ARPACK is an eigensolver. It works with a callback interface (you supply a function that computes $Ax$ for a given $x$ and it computes the eigenvalues by invoking this function multiple times). If you want to solve a generalized eigenvalue problem ($Ax = \lambda Bx$) you need to provide a callback for computing $x \rightarrow Bx$ as well.
• These callback functions can be implemented in the GPU (and it will work with ARPACK), now the way to implement it will depend on the structure of your matrices $A$ and $B$. You will use a different implementation if your matrix is full, diagonal or sparse. ViennaCL proposes several functions for different matrix structures.

http://www.caam.rice.edu/software/ARPACK/

http://viennacl.sourceforge.net/

Besides ARPACK, the same method can be applied any eigensolver that has a reverse communication API (i.e. with a callback that computes matrix-vector products), for instance SLEPc (see comments by Daniel Shapero below).

• You can also install PETSc so that it uses ViennaCL under the hood, and then use SLEPc as an eigensolver instead of ARPACK. For some unusual problems I've had better luck with SLEPc than ARPACK. – Daniel Shapero Jul 25 '15 at 16:50
• Yes you are right, I'm editing the post. – BrunoLevy Jul 27 '15 at 13:58