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> 72 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 template<
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
81 using execution_space =
typename DeviceType::execution_space;
82 using memory_space =
typename DeviceType::memory_space;
83 using device_type = Kokkos::Device<execution_space, memory_space>;
85 using node_type = Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType>;
86 using size_type = size_t;
88 using map_type = Xpetra::Map<LocalOrdinal, GlobalOrdinal, node_type>;
91 device_type, void,
size_t>;
97 typedef node_type
Node;
98 #undef MUELU_LWGRAPH_KOKKOS_SHORT 112 LWGraph_kokkos(
const local_graph_type& graph,
113 const RCP<const map_type>& domainMap,
114 const RCP<const map_type>& importMap,
115 const std::string& objectLabel =
"");
117 ~LWGraph_kokkos() { }
120 const RCP<const Teuchos::Comm<int> > GetComm()
const {
121 return domainMap_->getComm();
123 const RCP<const Map> GetDomainMap()
const {
127 const RCP<const Map> GetImportMap()
const {
132 KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices()
const {
133 return graph_.numRows();
136 KOKKOS_INLINE_FUNCTION size_type GetNodeNumEdges()
const {
137 return graph_.row_map(GetNodeNumVertices());
141 KOKKOS_INLINE_FUNCTION size_type getNodeMaxNumRowEntries ()
const {
142 return maxNumRowEntries_;
146 KOKKOS_INLINE_FUNCTION
typename local_graph_type::row_map_type getRowPtrs()
const {
147 return graph_.row_map;
151 KOKKOS_INLINE_FUNCTION
typename local_graph_type::entries_type getEntries()
const {
152 return graph_.entries;
159 KOKKOS_INLINE_FUNCTION
161 auto rowView = graph_.rowConst(i);
167 KOKKOS_INLINE_FUNCTION
bool isLocalNeighborVertex(LO i)
const {
168 return i >= minLocalIndex_ && i <= maxLocalIndex_;
172 KOKKOS_INLINE_FUNCTION
void SetBoundaryNodeMap(
const boundary_nodes_type bndry) {
173 dirichletBoundaries_ = bndry;
177 KOKKOS_INLINE_FUNCTION
const boundary_nodes_type GetBoundaryNodeMap()
const {
178 return dirichletBoundaries_;
182 std::string description()
const {
183 return "LWGraph (" + objectLabel_ +
")";
187 void print(Teuchos::FancyOStream &out,
const VerbLevel verbLevel =
Default)
const;
192 const local_graph_type graph_;
195 const RCP<const map_type> domainMap_;
196 const RCP<const map_type> importMap_;
199 boundary_nodes_type dirichletBoundaries_;
202 LO minLocalIndex_, maxLocalIndex_;
203 size_type maxNumRowEntries_;
206 const std::string& objectLabel_;
211 #define MUELU_LWGRAPH_KOKKOS_SHORT 212 #endif // HAVE_MUELU_KOKKOS_REFACTOR 213 #endif // MUELU_LWGRAPH_KOKKOS_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
Namespace for MueLu classes and methods.
MueLu::DefaultGlobalOrdinal GlobalOrdinal