Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update multigrid usage in test/mpi/solver #1737

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions test/matrix/csr_kernels2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Csr : public CommonTestFixture {
protected:
using Arr = gko::array<int>;
using Vec = gko::matrix::Dense<value_type>;
using Vec2 = gko::matrix::Dense<gko::next_precision_base<value_type>>;
using Mtx = gko::matrix::Csr<value_type>;
using ComplexVec = gko::matrix::Dense<std::complex<value_type>>;
using ComplexMtx = gko::matrix::Csr<std::complex<value_type>>;
Expand Down Expand Up @@ -123,27 +122,17 @@ class Csr : public CommonTestFixture {
square_mtx = Mtx::create(ref, strategy);
square_mtx->move_from(gen_mtx<Vec>(mtx_size[0], mtx_size[0], 1));
expected = gen_mtx<Vec>(mtx_size[0], num_vectors, 1);
expected2 = Vec2::create(ref);
expected2->copy_from(expected);
y = gen_mtx<Vec>(mtx_size[1], num_vectors, 1);
y2 = Vec2::create(ref);
y2->copy_from(y);
alpha = gko::initialize<Vec>({2.0}, ref);
alpha2 = gko::initialize<Vec2>({2.0}, ref);
beta = gko::initialize<Vec>({-1.0}, ref);
beta2 = gko::initialize<Vec2>({-1.0}, ref);
dmtx = Mtx::create(exec, strategy);
dmtx->copy_from(mtx);
dsquare_mtx = Mtx::create(exec, strategy);
dsquare_mtx->copy_from(square_mtx);
dresult = gko::clone(exec, expected);
dresult2 = gko::clone(exec, expected2);
dy = gko::clone(exec, y);
dy2 = gko::clone(exec, y2);
dalpha = gko::clone(exec, alpha);
dalpha2 = gko::clone(exec, alpha2);
dbeta = gko::clone(exec, beta);
dbeta2 = gko::clone(exec, beta2);

std::vector<int> tmp(mtx->get_size()[0], 0);
auto rng = std::default_random_engine{};
Expand Down Expand Up @@ -196,26 +185,18 @@ class Csr : public CommonTestFixture {
std::unique_ptr<ComplexMtx> complex_mtx;
std::unique_ptr<Mtx> square_mtx;
std::unique_ptr<Vec> expected;
std::unique_ptr<Vec2> expected2;
std::unique_ptr<Vec> y;
std::unique_ptr<Vec2> y2;
std::unique_ptr<Vec> alpha;
std::unique_ptr<Vec2> alpha2;
std::unique_ptr<Vec> beta;
std::unique_ptr<Vec2> beta2;

std::unique_ptr<Mtx> dmtx;
std::unique_ptr<Mtx> dmtx2;
std::unique_ptr<ComplexMtx> dcomplex_mtx;
std::unique_ptr<Mtx> dsquare_mtx;
std::unique_ptr<Vec> dresult;
std::unique_ptr<Vec2> dresult2;
std::unique_ptr<Vec> dy;
std::unique_ptr<Vec2> dy2;
std::unique_ptr<Vec> dalpha;
std::unique_ptr<Vec2> dalpha2;
std::unique_ptr<Vec> dbeta;
std::unique_ptr<Vec2> dbeta2;
std::unique_ptr<Arr> rpermute_idxs;
std::unique_ptr<Arr> cpermute_idxs;
std::unique_ptr<Perm> rpermutation;
Expand Down
6 changes: 1 addition & 5 deletions test/mpi/solver/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ struct CgWithMg : SimpleSolverTest<gko::solver::Cg<solver_value_type>> {
16u) // necessary since the test matrices have less
// rows than the default value
.with_criteria(
gko::stop::Iteration::build().with_max_iters(
iteration_count()),
gko::stop::ResidualNorm<value_type>::build()
.with_baseline(gko::stop::mode::absolute)
.with_reduction_factor(2 * reduction_factor())));
gko::stop::Iteration::build().with_max_iters(1u)));
}

static bool blacklisted(const std::string& test)
Expand Down
Loading