Skip to content

Commit

Permalink
backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Jan 13, 2016
1 parent 463654e commit b479dd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 45 deletions.
8 changes: 6 additions & 2 deletions amgcl/backend/builtin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,13 @@ crs<V, C, P> inverse(const crs<V, C, P> &A) {
return Ainv;
}

/// Builtin backend.
/**
* \ingroup backends
* The builtin backend does not have any dependencies except for the
* <a href="http://www.boost.org">Boost</a> libraries, and uses OpenMP for
* parallelization. Matrices are stored in the CRS format, and vectors are
* instances of ``std::vector<value_type>``. There is no usual overhead of
* moving the constructed hierarchy to the builtin backend, since the backend
* is used internally during setup.
*/
template <typename ValueType>
struct builtin {
Expand Down
11 changes: 6 additions & 5 deletions amgcl/backend/vexcl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ THE SOFTWARE.
namespace amgcl {
namespace backend {

/// VexCL backend
/**
* This is a backend that uses types defined in the VexCL GPGPU library
* (https://github.com/ddemidov/vexcl).
*
* \ingroup backends
* The backend uses the <a href="https://github.com/ddemidov/vexcl">VexCL</a>
* library for accelerating solution on the modern GPUs and multicore
* processors with the help of OpenCL or CUDA technologies.
* The VexCL backend stores the system matrix as ``vex::SpMat<real>`` and
* expects the right hand side and the solution vectors to be instances of the
* ``vex::vector<real>`` type.
*/
template <typename real>
struct vexcl {
Expand Down
42 changes: 4 additions & 38 deletions docs/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,18 @@ backend. This enables transparent acceleration of the solution phase with
OpenMP, OpenCL, CUDA, or any other technologies.

In order to use a backend, users must include its definition from the
corresponding file inside `amgcl/backend/` folder.
corresponding file inside `amgcl/backend/`_ folder.

.. _`amgcl/backend/`: https://github.com/ddemidov/amgcl/blob/master/amgcl/backend/
.. _`amgcl/backend/interface.hpp`: https://github.com/ddemidov/amgcl/blob/master/amgcl/backend/interface.hpp

Builtin
-------

The builtin backend does not have any dependencies except for the Boost_
libraries, and uses OpenMP for parallelization. Matrices are stored in the CRS
format, and vectors are instances of ``std::vector<value_type>``. There is no
usual overhead for moving the constructed hierarchy to the builtin backend,
since the backend is always used internally during setup.

Example:

.. code-block:: cpp
#include <amgcl/backend/builtin.hpp>
...
typedef amgcl::backend::builtin<double> Backend;
amgcl::make_solver<
amgcl::amg<Backend, amgcl::coarsening::smoothed_aggregation, amgcl::relaxation::spai0 >
amgcl::solver::cg<Backend>
> solve( boost::tie(n, ptr, col, val) );
std::vector<double> rhs(n), x(n);
...
solve(rhs, x);
.. doxygenstruct:: amgcl::backend::builtin

VexCL
-----

The VexCL backend uses VexCL_ library for accelerating solution on . VexCL is a C++
vector expression template library for OpenCL/CUDA and is able to utilize
compute power of the modern GPUs.

.. doxygenstruct:: amgcl::backend::vexcl

.. _Boost: http://www.boost.org/
.. _VexCL: http://github.com/ddemidov/vexcl

.. _`amgcl/backend/`: https://github.com/ddemidov/amgcl/blob/master/amgcl/backend/
.. _`amgcl/backend/interface.hpp`: https://github.com/ddemidov/amgcl/blob/master/amgcl/backend/interface.hpp

0 comments on commit b479dd8

Please sign in to comment.