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>
55 #include <Xpetra_ConfigDefs.hpp>
56 #include <Xpetra_Map.hpp>
71 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
75 template<
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
80 using execution_space =
typename DeviceType::execution_space;
81 using memory_space =
typename DeviceType::memory_space;
82 using device_type = Kokkos::Device<execution_space, memory_space>;
84 using node_type = Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType>;
85 using size_type = size_t;
87 using map_type = Xpetra::Map<LocalOrdinal, GlobalOrdinal, node_type>;
96 typedef node_type
Node;
97 #undef MUELU_LWGRAPH_KOKKOS_SHORT
111 LWGraph_kokkos(
const local_graph_type& graph,
112 const RCP<const map_type>& domainMap,
113 const RCP<const map_type>& importMap,
114 const std::string& objectLabel =
"");
116 ~LWGraph_kokkos() { }
119 const RCP<const Teuchos::Comm<int> > GetComm()
const {
120 return domainMap_->getComm();
122 const RCP<const Map> GetDomainMap()
const {
126 const RCP<const Map> GetImportMap()
const {
131 KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices()
const {
132 return graph_.numRows();
135 KOKKOS_INLINE_FUNCTION size_type GetNodeNumEdges()
const {
136 return graph_.row_map(GetNodeNumVertices());
140 KOKKOS_INLINE_FUNCTION size_type getNodeMaxNumRowEntries ()
const {
141 return maxNumRowEntries_;
145 KOKKOS_INLINE_FUNCTION
typename local_graph_type::row_map_type getRowPtrs()
const {
146 return graph_.row_map;
150 KOKKOS_INLINE_FUNCTION
typename local_graph_type::entries_type getEntries()
const {
151 return graph_.entries;
158 KOKKOS_INLINE_FUNCTION
160 auto rowView = graph_.rowConst(i);
166 KOKKOS_INLINE_FUNCTION
bool isLocalNeighborVertex(LO i)
const {
167 return i >= minLocalIndex_ && i <= maxLocalIndex_;
171 KOKKOS_INLINE_FUNCTION
void SetBoundaryNodeMap(
const boundary_nodes_type bndry) {
172 dirichletBoundaries_ = bndry;
176 KOKKOS_INLINE_FUNCTION
const boundary_nodes_type GetBoundaryNodeMap()
const {
177 return dirichletBoundaries_;
181 std::string description()
const {
182 return "LWGraph (" + objectLabel_ +
")";
191 const local_graph_type graph_;
194 const RCP<const map_type> domainMap_;
195 const RCP<const map_type> importMap_;
198 boundary_nodes_type dirichletBoundaries_;
201 LO minLocalIndex_, maxLocalIndex_;
202 size_type maxNumRowEntries_;
205 const std::string& objectLabel_;
210 #define MUELU_LWGRAPH_KOKKOS_SHORT
211 #endif // HAVE_MUELU_KOKKOS_REFACTOR
212 #endif // MUELU_LWGRAPH_KOKKOS_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal