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"
89 class AggregationPhase1Algorithm_kokkos :
90 public MueLu::AggregationAlgorithmBase_kokkos<LocalOrdinal,GlobalOrdinal,Node> {
91 #undef MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_SHORT
95 using memory_space =
typename LWGraph_kokkos::memory_space;
101 AggregationPhase1Algorithm_kokkos(
const RCP<const FactoryBase>& = Teuchos::null) { }
104 virtual ~AggregationPhase1Algorithm_kokkos() { }
115 const LWGraph_kokkos& graph,
116 Aggregates_kokkos& aggregates,
118 LO& numNonAggregatedNodes)
const;
120 void BuildAggregatesSerial(
const LWGraph_kokkos& graph, Aggregates_kokkos& aggregates,
121 std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes,
122 LO minNodesPerAggregate,
LO maxNodesPerAggregate,
123 LO maxNeighAlreadySelected, std::string& orderingStr)
const;
125 void BuildAggregatesDistance2(
const LO maxAggSize,
126 const LWGraph_kokkos& graph,
127 Aggregates_kokkos& aggregates,
129 LO& numNonAggregatedNodes)
const;
131 void BuildAggregatesDeterministic(
const LO maxAggSize,
132 const LWGraph_kokkos& graph,
133 Aggregates_kokkos& aggregates,
135 LO& numNonAggregatedNodes)
const;
138 std::string description()
const {
return "Phase 1 (main)"; }
140 enum struct Algorithm
146 static Algorithm algorithmFromName(
const std::string& name)
148 if(name ==
"Distance2")
149 return Algorithm::Distance2;
150 return Algorithm::Serial;
159 void RandomReorder(ArrayRCP<LO> list)
const;
162 int RandomOrdinal(
int min,
int max)
const;
168 #define MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_SHORT
169 #endif // HAVE_MUELU_KOKKOS_REFACTOR
170 #endif // MUELU_AGGREGATIONPHASE1ALGORITHM_KOKKOS_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
MueLu::DefaultGlobalOrdinal GlobalOrdinal