Skip to content

Commit

Permalink
Provide Backend::name() function
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Sep 26, 2014
1 parent e37a923 commit f66797d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions amgcl/backend/blaze.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ struct blaze {
params(const boost::property_tree::ptree&) {}
};

static std::string name() { return "blaze"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/block_crs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ struct block_crs {
{}
};

static std::string name() { return "block_crs"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(boost::shared_ptr< typename backend::builtin<real>::matrix > A,
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/builtin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ struct builtin {
params(const boost::property_tree::ptree&) {}
};

static std::string name() { return "builtin"; }

/// Copy matrix.
/** This is a noop for builtin backend. */
static boost::shared_ptr<matrix>
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ struct cuda {
{}
};

static std::string name() { return "cuda"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(boost::shared_ptr< typename builtin<real>::matrix > A, const params &prm)
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/eigen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ struct eigen {
params(const boost::property_tree::ptree&) {}
};

static std::string name() { return "eigen"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(boost::shared_ptr< typename builtin<real>::matrix > A, const params&)
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/vexcl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ struct vexcl {
}
};

static std::string name() { return "vexcl"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(boost::shared_ptr< typename builtin<real>::matrix > A, const params &prm)
Expand Down
2 changes: 2 additions & 0 deletions amgcl/backend/viennacl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct viennacl {
params(const boost::property_tree::ptree&) {}
};

static std::string name() { return "viennacl"; }

/// Copy matrix from builtin backend.
static boost::shared_ptr<matrix>
copy_matrix(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_backends, Backend, backend_list)
BOOST_FOREACH(amgcl::runtime::coarsening::type c, coarsening) {
BOOST_FOREACH(amgcl::runtime::relaxation::type r, relaxation) {
BOOST_FOREACH(amgcl::runtime::solver::type s, solver) {
std::cout << c << " " << r << " " << s << std::endl;
std::cout
<< Backend::name() << " "
<< c << " " << r << " " << s << std::endl;

try {
test_solver<Backend>(c, r, s);
Expand Down

0 comments on commit f66797d

Please sign in to comment.