46 #ifndef MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_DECL_HPP
47 #define MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_DECL_HPP
50 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
52 #include <KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
59 #include "MueLu_LWGraph_kokkos.hpp"
86 template <
class LocalOrdinal = int,
87 class GlobalOrdinal = LocalOrdinal,
89 class AggregationPhase1Algorithm_kokkos :
90 public MueLu::AggregationAlgorithmBase_kokkos<LocalOrdinal,GlobalOrdinal,Node> {
91 #undef MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_SHORT
99 AggregationPhase1Algorithm_kokkos(
const RCP<const FactoryBase>& = Teuchos::null) { }
102 virtual ~AggregationPhase1Algorithm_kokkos() { }
112 void BuildAggregates(
const ParameterList& params,
const LWGraph_kokkos& graph, Aggregates_kokkos& aggregates, std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes)
const;
114 void BuildAggregatesSerial(
const LWGraph_kokkos& graph, Aggregates_kokkos& aggregates,
115 std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes,
116 LO minNodesPerAggregate,
LO maxNodesPerAggregate,
117 LO maxNeighAlreadySelected, std::string& orderingStr)
const;
119 void BuildAggregatesDistance2(
const LWGraph_kokkos& graph, Aggregates_kokkos& aggregates,
120 std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes,
LO maxAggSize)
const;
123 std::string description()
const {
return "Phase 1 (main)"; }
125 enum struct Algorithm
131 static Algorithm algorithmFromName(
const std::string& name)
133 if(name ==
"Distance2")
134 return Algorithm::Distance2;
135 return Algorithm::Serial;
144 void RandomReorder(ArrayRCP<LO> list)
const;
147 int RandomOrdinal(
int min,
int max)
const;
153 #define MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_SHORT
154 #endif // HAVE_MUELU_KOKKOS_REFACTOR
155 #endif // MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_DECL_HPP