10 #ifndef MUELU_VECTORDROPPINGBASE_HPP
11 #define MUELU_VECTORDROPPINGBASE_HPP
21 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
29 using rowptr_type =
typename local_graph_type::row_map_type::non_const_type;
35 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
40 template <
class... Functors>
42 auto numNodes = graph_rowptr.extent(0) - 1;
44 #if !defined(HAVE_MUELU_DEBUG)
51 Kokkos::parallel_scan(
"MueLu::CoalesceDrop::CountEntries", range, countingFunctor, nnz);
54 template <
class... Functors>
55 static void runDroppingFunctors(
matrix_type& A,
matrix_type& mergedA,
typename matrix_type::local_ordinal_type& blkPartSize,
block_indices_view_type& rowTranslation,
block_indices_view_type& colTranslation,
results_view& results,
rowptr_type& filtered_rowptr,
rowptr_type& graph_rowptr,
nnz_count_type& nnz,
const bool useBlocking,
Level& level,
const Factory& factory, Functors&... functors) {
56 auto lclA = A.getLocalMatrixDevice();
58 auto BlockNumber = level.template Get<Teuchos::RCP<LocalOrdinalVector>>(
"BlockNumber", factory.
GetFactory(
"BlockNumber").get());
61 runDroppingFunctorsImpl(lclA, blkPartSize, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, block_diagonalize, functors...);
63 runDroppingFunctorsImpl(lclA, blkPartSize, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, functors...);
Kokkos::RangePolicy< LocalOrdinal, execution_space > range_type
typename device_type::memory_space memory_space
typename local_matrix_type::execution_space execution_space
Kokkos::View< DecisionType *, memory_space > results_view
Functor that checks that all entries have been marked.
typename Node::device_type device_type
typename GraphType::local_graph_type local_graph_type
Functor that executes a sequence of sub-functors on each block of rows.
Class that holds all level-specific information.
typename local_graph_type::row_map_type::non_const_type rowptr_type
Kokkos::pair< LocalOrdinal, LocalOrdinal > nnz_count_type
static void runDroppingFunctors(matrix_type &A, matrix_type &mergedA, typename matrix_type::local_ordinal_type &blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, const bool useBlocking, Level &level, const Factory &factory, Functors &...functors)
typename crs_matrix_type::local_matrix_type local_matrix_type
static void runDroppingFunctorsImpl(local_matrix_type &lclA, typename matrix_type::local_ordinal_type &blkPartSize, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, Functors &...functors)
virtual RCP< const CrsGraph > getCrsGraph() const =0
Functor that drops all entries that are not on the block diagonal.
typename Kokkos::View< LocalOrdinal *, typename Node::device_type > block_indices_view_type
const RCP< const FactoryBase > GetFactory(const std::string &varName) const
Default implementation of FactoryAcceptor::GetFactory()