-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters