Skip to content

Commit

Permalink
revert to old permutation interface for now
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Oct 10, 2023
1 parent 27d37ed commit 5d019bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions benchmark/utils/general_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,28 @@ std::unique_ptr<gko::matrix::Permutation<IndexType>> reorder(
throw std::runtime_error{"Unknown reordering algorithm " +
FLAGS_reorder};
}
mtx->permute(perm)->write(data);
auto perm_arr =
gko::array<IndexType>::view(ref, data.size[0], perm->get_permutation());
gko::as<Csr>(mtx->permute(&perm_arr))->write(data);
test_case["reordered"] = FLAGS_reorder;
return perm;
}


template <typename ValueType, typename IndexType>
void permute(std::unique_ptr<gko::matrix::Dense<ValueType>>& vec,
const gko::matrix::Permutation<IndexType>* perm)
gko::matrix::Permutation<IndexType>* perm)
{
vec = vec->permute(perm, gko::matrix::permute_mode::rows);
auto perm_arr = gko::array<IndexType>::view(
perm->get_executor(), perm->get_size()[0], perm->get_permutation());
vec = gko::as<gko::matrix::Dense<ValueType>>(vec->row_permute(&perm_arr));
}


template <typename ValueType, typename IndexType>
void permute(
std::unique_ptr<gko::experimental::distributed::Vector<ValueType>>& vec,
const gko::matrix::Permutation<IndexType>* perm)
gko::matrix::Permutation<IndexType>* perm)
{}


Expand Down

0 comments on commit 5d019bb

Please sign in to comment.