47 #ifndef MUELU_AGGREGATES_KOKKOS_DECL_HPP
48 #define MUELU_AGGREGATES_KOKKOS_DECL_HPP
51 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
53 #include <Kokkos_StaticCrsGraph.hpp>
54 #include <KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
65 #include "MueLu_IndexManager_kokkos.hpp"
67 #define MUELU_UNAGGREGATED -1
70 #define MUELU_UNASSIGNED -1
103 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 class Aggregates_kokkos;
106 template <
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
107 class Aggregates_kokkos<LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> > :
public BaseClass {
109 typedef LocalOrdinal local_ordinal_type;
110 typedef GlobalOrdinal global_ordinal_type;
111 typedef typename DeviceType::execution_space execution_space;
113 typedef Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> node_type;
114 typedef DeviceType device_type;
121 typedef node_type Node;
122 #undef MUELU_AGGREGATES_KOKKOS_SHORT
136 Aggregates_kokkos(LWGraph_kokkos graph);
143 Aggregates_kokkos(
const RCP<const Map>& map);
148 virtual ~Aggregates_kokkos() { }
151 KOKKOS_INLINE_FUNCTION
LO GetNumAggregates()
const {
152 return numAggregates_;
159 void SetNumAggregates(
LO nAggregates) { numAggregates_ = nAggregates; }
165 RCP<IndexManager_kokkos>& GetIndexManager() {
return geoData_; }
171 void SetIndexManager(RCP<IndexManager_kokkos> & geoData) { geoData_ = geoData; }
174 KOKKOS_INLINE_FUNCTION
void AggregatesCrossProcessors(
const bool& flag) {
175 aggregatesIncludeGhosts_ = flag;
182 KOKKOS_INLINE_FUNCTION
bool AggregatesCrossProcessors()
const {
183 return aggregatesIncludeGhosts_;
190 RCP<LOVector>& GetVertex2AggIdNonConst() {
return vertex2AggId_; }
196 RCP<LOVector>& GetProcWinnerNonConst() {
return procWinner_; }
201 const RCP<LOVector>& GetVertex2AggId()
const {
return vertex2AggId_; }
207 const RCP<LOVector>& GetProcWinner()
const {
return procWinner_; }
210 KOKKOS_INLINE_FUNCTION
211 bool IsRoot(
LO i)
const {
return isRoot_(i); }
217 KOKKOS_INLINE_FUNCTION
218 void SetIsRoot(
LO i,
bool value =
true) { isRoot_(i) = value; }
220 const RCP<const Map> GetMap()
const;
231 typename aggregates_sizes_type::const_type ComputeAggregateSizes(
bool forceRecompute =
false)
const;
233 local_graph_type GetGraph()
const;
239 std::string description()
const;
252 RCP<LOVector> vertex2AggId_;
258 RCP<LOVector> procWinner_;
263 RCP<IndexManager_kokkos> geoData_;
268 bool aggregatesIncludeGhosts_;
272 aggregates_sizes_type aggregateSizes_;
276 local_graph_type graph_;
280 GO GetNumGlobalAggregates()
const;
285 #endif // HAVE_MUELU_KOKKOS_REFACTOR
287 #define MUELU_AGGREGATES_KOKKOS_SHORT
288 #endif // MUELU_AGGREGATES_KOKKOS_DECL_HPP