46 #ifndef MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
47 #define MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
49 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
51 #include <Teuchos_Comm.hpp>
52 #include <Teuchos_CommHelpers.hpp>
56 #include "MueLu_IsolatedNodeAggregationAlgorithm_kokkos.hpp"
58 #include "MueLu_LWGraph_kokkos.hpp"
59 #include "MueLu_Aggregates_kokkos.hpp"
65 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 void IsolatedNodeAggregationAlgorithm_kokkos<LocalOrdinal, GlobalOrdinal, Node>::
67 BuildAggregates(
const ParameterList& ,
68 const LWGraph_kokkos& graph,
71 LO& numNonAggregatedNodes)
const {
72 Monitor m(*
this,
"BuildAggregates");
74 using memory_space =
typename LWGraph_kokkos::memory_space;
77 = Kokkos::create_mirror(aggstat);
79 std::vector<unsigned> aggStat;
80 aggStat.resize(aggstatHost.
extent(0));
81 for(
size_t idx = 0; idx < aggstatHost.
extent(0); ++idx) {
82 aggStat[idx] = aggstatHost(idx);
85 const LO numRows = graph.GetNodeNumVertices();
88 for (
LO i = 0; i < numRows; i++)
89 if (aggStat[i] !=
AGGREGATED && aggStat[i] !=
IGNORED && graph.getNeighborVertices(i).length == 1) {
91 numNonAggregatedNodes--;
94 for(
size_t idx = 0; idx < aggstatHost.
extent(0); ++idx) {
95 aggstatHost(idx) = aggStat[idx];
102 #endif // HAVE_MUELU_KOKKOS_REFACTOR
103 #endif // MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
void deep_copy(const View< DT, DP...> &dst, typename ViewTraits< DT, DP...>::const_value_type &value, typename std::enable_if< std::is_same< typename ViewTraits< DT, DP...>::specialize, void >::value >::type *=0)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< std::is_integral< iType >::value, size_t >::type extent(const iType &r) const noexcept