|
15 | 15 | namespace { |
16 | 16 |
|
17 | 17 |
|
18 | | -template <typename ValueIndexType> |
19 | | -class RsFactory : public ::testing::Test { |
20 | | -protected: |
21 | | - using value_type = |
22 | | - typename std::tuple_element<0, decltype(ValueIndexType())>::type; |
23 | | - using index_type = |
24 | | - typename std::tuple_element<1, decltype(ValueIndexType())>::type; |
25 | | - using Mtx = gko::matrix::Csr<value_type, index_type>; |
26 | | - using Vec = gko::matrix::Dense<value_type>; |
27 | | - using MgLevel = gko::multigrid::Rs<value_type, index_type>; |
28 | | - RsFactory() |
29 | | - : exec(gko::ReferenceExecutor::create()), |
30 | | - rs_factory(MgLevel::build() |
31 | | - .with_coarse_rows(gko::array<index_type>(exec, {2, 3})) |
32 | | - .with_skip_sorting(true) |
33 | | - .on(exec)) |
34 | | - {} |
35 | | - |
36 | | - std::shared_ptr<const gko::Executor> exec; |
37 | | - std::unique_ptr<typename MgLevel::Factory> rs_factory; |
38 | | -}; |
39 | | - |
40 | | -TYPED_TEST_SUITE(RsFactory, gko::test::ValueIndexTypes, |
41 | | - PairTypenameNameGenerator); |
42 | | - |
43 | | - |
44 | | -TYPED_TEST(RsFactory, FactoryKnowsItsExecutor) |
45 | | -{ |
46 | | - ASSERT_EQ(this->rs_factory->get_executor(), this->exec); |
47 | | -} |
48 | | - |
49 | | - |
50 | | -TYPED_TEST(RsFactory, DefaultSetting) |
51 | | -{ |
52 | | - using MgLevel = typename TestFixture::MgLevel; |
53 | | - auto factory = MgLevel::build().on(this->exec); |
54 | | - |
55 | | - ASSERT_EQ(factory->get_parameters().coarse_rows.get_const_data(), nullptr); |
56 | | - ASSERT_EQ(factory->get_parameters().skip_sorting, false); |
57 | | -} |
58 | | - |
59 | | - |
60 | | -TYPED_TEST(RsFactory, SetCoarseRows) |
61 | | -{ |
62 | | - using T = typename TestFixture::index_type; |
63 | | - GKO_ASSERT_ARRAY_EQ(this->rs_factory->get_parameters().coarse_rows, |
64 | | - gko::array<T>(this->exec, {2, 3})); |
65 | | -} |
66 | | - |
67 | | - |
68 | | -TYPED_TEST(RsFactory, SetSkipSorting) |
69 | | -{ |
70 | | - ASSERT_EQ(this->rs_factory->get_parameters().skip_sorting, true); |
71 | | -} |
| 18 | +// template <typename ValueIndexType> |
| 19 | +// class RsFactory : public ::testing::Test { |
| 20 | +// protected: |
| 21 | +// using value_type = |
| 22 | +// typename std::tuple_element<0, decltype(ValueIndexType())>::type; |
| 23 | +// using index_type = |
| 24 | +// typename std::tuple_element<1, decltype(ValueIndexType())>::type; |
| 25 | +// using Mtx = gko::matrix::Csr<value_type, index_type>; |
| 26 | +// using Vec = gko::matrix::Dense<value_type>; |
| 27 | +// using MgLevel = gko::multigrid::Rs<value_type, index_type>; |
| 28 | +// RsFactory() |
| 29 | +// : exec(gko::ReferenceExecutor::create()), |
| 30 | +// rs_factory(MgLevel::build() |
| 31 | +// .with_coarse_rows(gko::array<index_type>(exec, {2, |
| 32 | +// 3})) .with_skip_sorting(true) .on(exec)) |
| 33 | +// {} |
| 34 | + |
| 35 | +// std::shared_ptr<const gko::Executor> exec; |
| 36 | +// std::unique_ptr<typename MgLevel::Factory> rs_factory; |
| 37 | +// }; |
| 38 | + |
| 39 | +// TYPED_TEST_SUITE(RsFactory, gko::test::ValueIndexTypes, |
| 40 | +// PairTypenameNameGenerator); |
| 41 | + |
| 42 | + |
| 43 | +// TYPED_TEST(RsFactory, FactoryKnowsItsExecutor) |
| 44 | +// { |
| 45 | +// ASSERT_EQ(this->rs_factory->get_executor(), this->exec); |
| 46 | +// } |
| 47 | + |
| 48 | + |
| 49 | +// TYPED_TEST(RsFactory, DefaultSetting) |
| 50 | +// { |
| 51 | +// using MgLevel = typename TestFixture::MgLevel; |
| 52 | +// auto factory = MgLevel::build().on(this->exec); |
| 53 | + |
| 54 | +// ASSERT_EQ(factory->get_parameters().coarse_rows.get_const_data(), |
| 55 | +// nullptr); ASSERT_EQ(factory->get_parameters().skip_sorting, false); |
| 56 | +// } |
| 57 | + |
| 58 | + |
| 59 | +// TYPED_TEST(RsFactory, SetCoarseRows) |
| 60 | +// { |
| 61 | +// using T = typename TestFixture::index_type; |
| 62 | +// GKO_ASSERT_ARRAY_EQ(this->rs_factory->get_parameters().coarse_rows, |
| 63 | +// gko::array<T>(this->exec, {2, 3})); |
| 64 | +// } |
| 65 | + |
| 66 | + |
| 67 | +// TYPED_TEST(RsFactory, SetSkipSorting) |
| 68 | +// { |
| 69 | +// ASSERT_EQ(this->rs_factory->get_parameters().skip_sorting, true); |
| 70 | +// } |
72 | 71 |
|
73 | 72 |
|
74 | 73 | } // namespace |
0 commit comments