From 867fdfe32191d317be7e923ef4717cf71d357e1f Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Thu, 19 Nov 2020 09:50:25 +0100 Subject: [PATCH 1/2] add triangular solvers to benchmark --- BENCHMARKING.md | 6 ++++-- benchmark/solver/solver.cpp | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/BENCHMARKING.md b/BENCHMARKING.md index a26cfe5ee1a..b1c7e409b4b 100644 --- a/BENCHMARKING.md +++ b/BENCHMARKING.md @@ -293,8 +293,10 @@ The supported environment variables are described in the following list: library formats (cuSPARSE with `cusp_` prefix or hipSPARSE with `hipsp_` prefix) can be used as well. Multiple options can be passed. The default is `csr,coo,ell,hybrid,sellp`. -* `SOLVERS={bicgstab,bicg,cg,cgs,fcg,gmres}` - the solvers which should be - benchmarked. Multiple options can be passed. The default is `cg`. +* `SOLVERS={bicgstab,bicg,cg,cgs,fcg,gmres,lower_trs,upper_trs}` - the solvers + which should be benchmarked. Multiple options can be passed. + Note that `lower/upper_trs` by default don't use a preconditioner, as they + are exact direct solvers. The default is `cg`. * `SOLVERS_PRECISION=` - the minimal residual reduction before which the solver should stop. The default is `1e-6`. * `SOLVERS_MAX_ITERATION=` - the maximum number of iterations with which diff --git a/benchmark/solver/solver.cpp b/benchmark/solver/solver.cpp index f5cfeae39ea..f4c88521dbe 100644 --- a/benchmark/solver/solver.cpp +++ b/benchmark/solver/solver.cpp @@ -65,10 +65,10 @@ DEFINE_bool( rel_residual, false, "Use relative residual instead of residual reduction stopping criterion"); -DEFINE_string( - solvers, "cg", - "A comma-separated list of solvers to run. " - "Supported values are: bicgstab, bicg, cg, cgs, fcg, gmres, overhead"); +DEFINE_string(solvers, "cg", + "A comma-separated list of solvers to run. " + "Supported values are: bicgstab, bicg, cg, cgs, fcg, gmres, " + "lower_trs, upper_trs, overhead"); DEFINE_uint32( nrhs, 1, @@ -167,6 +167,20 @@ const std::map( .with_preconditioner(give(precond)) .on(exec); }}, + {"lower_trs", + [](std::shared_ptr exec, + std::shared_ptr precond) { + return gko::solver::LowerTrs<>::build() + .with_num_rhs(FLAGS_nrhs) + .on(exec); + }}, + {"upper_trs", + [](std::shared_ptr exec, + std::shared_ptr precond) { + return gko::solver::UpperTrs<>::build() + .with_num_rhs(FLAGS_nrhs) + .on(exec); + }}, {"overhead", create_solver>}}; From f25a8d7cd761535c15bead618bfd6c22f4b71176 Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Thu, 19 Nov 2020 17:26:23 +0100 Subject: [PATCH 2/2] review update Co-authored-by: tcojean Co-authored-by: Aditya Kashi --- BENCHMARKING.md | 6 +++--- benchmark/solver/solver.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BENCHMARKING.md b/BENCHMARKING.md index b1c7e409b4b..043cdd71cf7 100644 --- a/BENCHMARKING.md +++ b/BENCHMARKING.md @@ -294,9 +294,9 @@ The supported environment variables are described in the following list: prefix) can be used as well. Multiple options can be passed. The default is `csr,coo,ell,hybrid,sellp`. * `SOLVERS={bicgstab,bicg,cg,cgs,fcg,gmres,lower_trs,upper_trs}` - the solvers - which should be benchmarked. Multiple options can be passed. - Note that `lower/upper_trs` by default don't use a preconditioner, as they - are exact direct solvers. The default is `cg`. + which should be benchmarked. Multiple options can be passed. The default + is `cg`. Note that `lower/upper_trs` by default don't use a preconditioner, + as they are by default exact direct solvers. * `SOLVERS_PRECISION=` - the minimal residual reduction before which the solver should stop. The default is `1e-6`. * `SOLVERS_MAX_ITERATION=` - the maximum number of iterations with which diff --git a/benchmark/solver/solver.cpp b/benchmark/solver/solver.cpp index f4c88521dbe..578c89a9473 100644 --- a/benchmark/solver/solver.cpp +++ b/benchmark/solver/solver.cpp @@ -169,14 +169,14 @@ const std::map( }}, {"lower_trs", [](std::shared_ptr exec, - std::shared_ptr precond) { + std::shared_ptr) { return gko::solver::LowerTrs<>::build() .with_num_rhs(FLAGS_nrhs) .on(exec); }}, {"upper_trs", [](std::shared_ptr exec, - std::shared_ptr precond) { + std::shared_ptr) { return gko::solver::UpperTrs<>::build() .with_num_rhs(FLAGS_nrhs) .on(exec);