46 #ifndef MUELU_LWGRAPH_KOKKOS_DECL_HPP
47 #define MUELU_LWGRAPH_KOKKOS_DECL_HPP
50 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
52 #include <Kokkos_StaticCrsGraph.hpp>
53 #include <KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
71 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
75 template<
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
76 class LWGraph_kokkos<LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType>> {
78 typedef LocalOrdinal local_ordinal_type;
79 typedef GlobalOrdinal global_ordinal_type;
80 typedef typename DeviceType::execution_space execution_space;
82 typedef Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> node_type;
83 typedef size_t size_type;
92 typedef node_type Node;
93 #undef MUELU_LWGRAPH_KOKKOS_SHORT
107 LWGraph_kokkos(
const local_graph_type& graph,
108 const RCP<const map_type>& domainMap,
109 const RCP<const map_type>& importMap,
110 const std::string& objectLabel =
"");
112 ~LWGraph_kokkos() { }
115 const RCP<const Teuchos::Comm<int> > GetComm()
const {
116 return domainMap_->getComm();
118 const RCP<const Map> GetDomainMap()
const {
122 const RCP<const Map> GetImportMap()
const {
127 KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices()
const {
128 return graph_.numRows();
131 KOKKOS_INLINE_FUNCTION size_type GetNodeNumEdges()
const {
132 return graph_.row_map(GetNodeNumVertices());
139 KOKKOS_INLINE_FUNCTION
141 auto rowView = graph_.rowConst(i);
147 KOKKOS_INLINE_FUNCTION
bool isLocalNeighborVertex(
LO i)
const {
148 return i >= minLocalIndex_ && i <= maxLocalIndex_;
152 KOKKOS_INLINE_FUNCTION
void SetBoundaryNodeMap(
const boundary_nodes_type bndry) {
153 dirichletBoundaries_ = bndry;
157 KOKKOS_INLINE_FUNCTION size_type getNodeMaxNumRowEntries ()
const {
158 return maxNumRowEntries_;
162 KOKKOS_INLINE_FUNCTION
const boundary_nodes_type GetBoundaryNodeMap()
const {
163 return dirichletBoundaries_;
167 std::string description()
const {
168 return "LWGraph (" + objectLabel_ +
")";
177 const local_graph_type graph_;
180 const RCP<const map_type> domainMap_;
181 const RCP<const map_type> importMap_;
184 boundary_nodes_type dirichletBoundaries_;
187 LO minLocalIndex_, maxLocalIndex_;
188 size_type maxNumRowEntries_;
191 const std::string& objectLabel_;
196 #define MUELU_LWGRAPH_KOKKOS_SHORT
197 #endif // HAVE_MUELU_KOKKOS_REFACTOR
198 #endif // MUELU_LWGRAPH_KOKKOS_DECL_HPP