|Re: [eigen] Cross-referencing Eigen and ViennaCL for iterative solvers?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Cross-referencing Eigen and ViennaCL for iterative solvers?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sun, 6 Feb 2011 13:54:07 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=0baNX8LumEOVFmgUs6mGIzTPHpwqopLJAcljvNBBrJk=; b=A2jMTutRdaYmXX9qwvNGOSYHQxhyCkJtQJbdKhZ4XpBkK1TpMI7dwhFrJCPC5up/n5 fb9TH/xWbZXjT6jmWw6ltDICnHylUcoiQ7huBZkxPoUk3u5rx6ZHSPi65ksy76A3JqED ZOhauokIR83bc7YNhgZUPyFFdedeKQ+S9f7ZQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=nm4yMuprChfggMAQtJmobbtWlHwsbFMTaDQJjUofgJnLnsuIk9IDBe7V5wTd2DCYMV UoSDMlW4dp94BmCv9mkyIdmSJI4WUttL+kyi22uet/Ce+hhoCgOHpHpzWxt2H18M4UNv Lwr6GpfsMgRR2VrehSx3OS0RYzDUN5uvN90jA=
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 http://viennacl.sourceforge.net/
> 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,
> --- code end ---
> In my view, both projects would benefit equally. What do you think about it?
> Best regards,
> 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... ;-)