Re: [eigen] Cross-referencing Eigen and ViennaCL for iterative solvers?

[ Thread Index | Date Index | More Archives ]

Hi, and thanks for writing, I didn't know about ViennaCL.

2011/2/6 Karl Rupp <rupp@xxxxxxxxxxxxxxxx>:
> Hi Eigen developers,
> I'm one of the developers of ViennaCL, a linear algebra library for GPUs and
> multi-core CPUs built on top of OpenCL (see
> ).
> As far as I can tell from the online documentation, Eigen's focus is mostly
> on dense matrix algebra, where you guys do a great job. However, the sparse
> matrix section seems to be in its infancy still. On the other hand, our
> library provides generic implementations for iterative solvers (CG,
> BiCGStab, GMRES at present), which run well with both the built-in ViennaCL
> types as well as the boost::numeric::ublas types. We think about adding
> direct support for Eigen types, which should require only a few lines of
> code. Moreover, we would also provide overloaded copy() routines, that copy
> Eigen-types to their ViennaCL counterparts and vice versa. This way
> programmers can enjoy the convenient interface of Eigen and at the same time
> run time-critical operations like dense matrix-matrix products with ViennaCL
> on e.g. GPUs.
> Therefore I'd like to propose a cross-referencing of our projects: Similar
> to the current direct solvers for sparse matrices, you could add a section
> "Using iterative solvers" to the sparse matrix docs and refer to ViennaCL..
> Similarly, we promote the Eigen-interface in our project.

(Disclaimer: only Gael is authoritative on Sparse and level 3 BLAS stuff.)

Why stop here? :-) If ViennaCL provides high performance Sparse
solvers, then such
"use-viennacl-as-backend-for-sparse-solvers-in-eigen" code could be
added to Eigen's own sparse solvers module; also, I see on your
website that you also do level 3 BLAS operations using OpenCL, this
sounds interesting to me, we should then consider offering an optional
back-end using viennacl also for dense matrix products.

Such experimental stuff can be initially developed under unsupported/
and move to Eigen/ when it's ready. The Sparse solvers stuff is
intended to move to Eigen/ in the 3.1 release.

I also note that ViennaCL is headers-only like Eigen, which makes it a
good canditate for us to collaborate with, since if eventually it
became the best solution for us to leverage GPUs, we could import a
copy into our own tree.


> Unlike the "unsupported" direct solver modules, you don't have to do any
> coding at all, C++ takes care of all that. :-)
> Thus, users could write something like
> --- code begin --
> Eigen::SparseMatrix<double> system_matrix(dim, dim);
> Eigen::VectorXd rhs_vector(dim);
> //fill system_matrix and rhs_vector here
> //solve system using CG, tolerance 1e-10, max. 100 iterations:
> viennacl::linalg::cg_tag solver_tag(1e-10, 100);
> Eigen::VectorXd result = viennacl::linalg::solve(system_matrix,
>                                                 rhs_vector,
>                                                 solver_tag);
> --- code end ---
> In my view, both projects would benefit equally. What do you think about it?
> Best regards,
> Karli
> PS: I've seen that you are about to launch a new beta version. Since this is
> a rather intense phase, I hope my email won't get lost... ;-)

Mail converted by MHonArc 2.6.19+