Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
- fix failing tests
- move to experimental
  • Loading branch information
upsj committed Mar 17, 2023
1 parent 7c1e4f8 commit 3a3a38a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmake/Modules/FindMETIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# where to find metis.h or metis64.h
#
# ``METIS_HEADER``
# either metis64.h or metis.h, dependent in which was found
# either metis64.h or metis.h, dependent on which was found
#
# ``METIS_LIBRARIES``
# the libraries to link against in order to use the METIS library.
Expand Down
4 changes: 3 additions & 1 deletion core/reorder/nested_dissection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


namespace gko {
namespace experimental {
namespace reorder {
namespace {

Expand Down Expand Up @@ -177,7 +178,7 @@ std::unique_ptr<LinOp> NestedDissection<ValueType, IndexType>::generate_impl(
const auto num_rows = host_mtx->get_size()[0];
array<IndexType> permutation(host_exec, num_rows);
array<IndexType> inv_permutation(host_exec, num_rows);
exec->run(make_metis_nd(exec, num_rows, host_mtx->get_const_row_ptrs(),
exec->run(make_metis_nd(host_exec, num_rows, host_mtx->get_const_row_ptrs(),
host_mtx->get_const_col_idxs(),
build_metis_options(parameters_.options),
permutation.get_data(),
Expand All @@ -195,4 +196,5 @@ GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(GKO_DECLARE_ND);


} // namespace reorder
} // namespace experimental
} // namespace gko
2 changes: 2 additions & 0 deletions include/ginkgo/core/reorder/nested_dissection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


namespace gko {
namespace experimental {
/**
* @brief The Reorder namespace.
*
Expand Down Expand Up @@ -137,6 +138,7 @@ class NestedDissection


} // namespace reorder
} // namespace experimental
} // namespace gko


Expand Down
2 changes: 0 additions & 2 deletions test/matrix/sparsity_csr_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ namespace {

class SparsityCsr : public CommonTestFixture {
protected:
using value_type = double;
using index_type = int;
using Mtx = gko::matrix::SparsityCsr<value_type, index_type>;

SparsityCsr() : rng{9312}
Expand Down
2 changes: 1 addition & 1 deletion test/reorder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if (GINKGO_HAVE_METIS)
ginkgo_create_common_test(nested_dissection)
endif()
endif()
17 changes: 12 additions & 5 deletions test/reorder/nested_dissection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/reorder/nested_dissection.hpp>


Expand All @@ -47,11 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
template <typename IndexType>
class NestedDissection : public CommonTestFixture {
protected:
using v_type = double;
using i_type = IndexType;
using matrix_type = gko::matrix::Csr<v_type, i_type>;
using reorder_type = gko::reorder::NestedDissection<v_type, i_type>;
using perm_type = gko::matrix::Permutation<i_type>;
using index_type = IndexType;
using matrix_type = gko::matrix::Csr<value_type, index_type>;
using reorder_type =
gko::experimental::reorder::NestedDissection<value_type, index_type>;
using perm_type = gko::matrix::Permutation<index_type>;


NestedDissection()
Expand All @@ -77,4 +78,10 @@ TYPED_TEST(NestedDissection, ResultIsEquivalentToRef)
{
auto perm = this->nd_factory->generate(this->mtx);
auto dperm = this->dnd_factory->generate(this->dmtx);

auto perm_array = gko::make_array_view(this->ref, this->mtx->get_size()[0],
perm->get_permutation());
auto dperm_array = gko::make_array_view(
this->exec, this->mtx->get_size()[0], dperm->get_permutation());
GKO_ASSERT_ARRAY_EQ(perm_array, dperm_array);
}

0 comments on commit 3a3a38a

Please sign in to comment.