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> 58 #include <Xpetra_Map_fwd.hpp> 59 #include <Xpetra_Vector_fwd.hpp> 60 #include <Xpetra_VectorFactory_fwd.hpp> 66 #define MUELU_UNAGGREGATED -1 69 #define MUELU_UNASSIGNED -1 102 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 class Aggregates_kokkos;
105 template <
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
106 class Aggregates_kokkos<LocalOrdinal, GlobalOrdinal,
Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> > :
public BaseClass {
108 typedef LocalOrdinal local_ordinal_type;
109 typedef GlobalOrdinal global_ordinal_type;
110 typedef typename DeviceType::execution_space execution_space;
112 typedef Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> node_type;
113 typedef DeviceType device_type;
120 typedef node_type Node;
121 #undef MUELU_AGGREGATES_KOKKOS_SHORT 135 Aggregates_kokkos(LWGraph_kokkos graph);
142 Aggregates_kokkos(
const RCP<const Map>& map);
147 virtual ~Aggregates_kokkos() { }
150 KOKKOS_INLINE_FUNCTION LO GetNumAggregates()
const {
158 void SetNumAggregates(LO nAggregates) { nAggregates_ = nAggregates; }
161 KOKKOS_INLINE_FUNCTION
void AggregatesCrossProcessors(
const bool& flag) {
162 aggregatesIncludeGhosts_ = flag;
169 KOKKOS_INLINE_FUNCTION
bool AggregatesCrossProcessors()
const {
170 return aggregatesIncludeGhosts_;
177 RCP<LOVector>& GetVertex2AggIdNonConst() {
return vertex2AggId_; }
183 RCP<LOVector>& GetProcWinnerNonConst() {
return procWinner_; }
188 const RCP<LOVector>& GetVertex2AggId()
const {
return vertex2AggId_; }
194 const RCP<LOVector>& GetProcWinner()
const {
return procWinner_; }
197 bool IsRoot(LO i)
const {
return isRoot_[i]; }
203 void SetIsRoot(LO i,
bool value =
true) { isRoot_[i] = value; }
205 const RCP<const Map> GetMap()
const;
220 typename aggregates_sizes_type::const_type ComputeAggregateSizes(
bool forceRecompute =
true,
bool cacheSizes =
false)
const;
222 local_graph_type GetGraph()
const;
228 std::string description()
const;
232 void print(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const;
241 RCP<LOVector> vertex2AggId_;
247 RCP<LOVector> procWinner_;
249 Teuchos::ArrayRCP<bool> isRoot_;
252 bool aggregatesIncludeGhosts_;
256 aggregates_sizes_type aggregateSizes_;
260 GO GetNumGlobalAggregates()
const;
265 #endif // HAVE_MUELU_KOKKOS_REFACTOR 267 #define MUELU_AGGREGATES_KOKKOS_SHORT 268 #endif // MUELU_AGGREGATES_KOKKOS_DECL_HPP
Namespace for MueLu classes and methods.