Skip to content

Commit

Permalink
backends, api
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Jan 13, 2016
1 parent b1d7043 commit e257892
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 3 deletions.
1 change: 0 additions & 1 deletion amgcl/backend/builtin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ crs<V, C, P> inverse(const crs<V, C, P> &A) {

/// Builtin backend.
/**
* \param real Value type.
* \ingroup backends
*/
template <typename ValueType>
Expand Down
1 change: 0 additions & 1 deletion amgcl/backend/vexcl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ namespace backend {
* This is a backend that uses types defined in the VexCL GPGPU library
* (https://github.com/ddemidov/vexcl).
*
* \param real Value type.
* \ingroup backends
*/
template <typename real>
Expand Down
7 changes: 7 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ table.citation td {
float: left;
max-width: 85%;
}

dl.class {
padding-left: 5px;
border-left-color: #aaaaaa;
border-left-style: solid;
border-left-width: 1px;
}
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ API Reference
=============

.. doxygenclass:: amgcl::make_solver
:members:

Backends
--------

.. doxygenstruct:: amgcl::backend::builtin

.. doxygenstruct:: amgcl::backend::vexcl
56 changes: 56 additions & 0 deletions docs/backends.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,58 @@
Backends
========

A backend in AMGCL is a class that defines matrix and vector types together
with several operations on them, such as creation, matrix-vector products,
elementwise vector operations, inner products etc. The
`amgcl/backend/interface.hpp`_ file defines an interface that each backend
should extend. The AMG hierarchy is moved to the specified backend upon
construction. The solution phase then uses types and operations defined in the
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.

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);
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.

.. _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

1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

breathe_projects = {'AMGCL' : 'xml'}
breathe_default_project = 'AMGCL'
breathe_default_members = ['members']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down

0 comments on commit e257892

Please sign in to comment.