46#ifndef MUELU_LOCALLWGRAPH_KOKKOS_DEF_HPP
47#define MUELU_LOCALLWGRAPH_KOKKOS_DEF_HPP
49#include <Kokkos_Core.hpp>
51#include <Teuchos_ArrayView.hpp>
52#include <Xpetra_Map.hpp>
60 template<
class LocalOrdinal,
class RowType>
61 class MaxNumRowEntriesFunctor {
63 MaxNumRowEntriesFunctor(RowType rowPointers) :
rowPointers_(rowPointers) { }
65 KOKKOS_INLINE_FUNCTION
66 void operator()(
const LocalOrdinal i,
size_t& maxLength)
const {
69 maxLength = (d > maxLength ? d : maxLength);
72 KOKKOS_INLINE_FUNCTION
73 void join(
volatile size_t& dest,
const volatile size_t& src) {
74 dest = (dest > src ? dest : src);
77 KOKKOS_INLINE_FUNCTION
78 void init(
size_t& initValue) {
88 template<
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
91 const RCP<const map_type>& domainMap)
94 minLocalIndex_ = domainMap->getMinLocalIndex();
95 maxLocalIndex_ = domainMap->getMaxLocalIndex();
97 MaxNumRowEntriesFunctor<LO,typename local_graph_type::row_map_type> maxNumRowEntriesFunctor(graph_.row_map);
98 Kokkos::parallel_reduce(
"MueLu:LocalLWGraph:LWGraph:maxnonzeros",
range_type(0,graph_.numRows()), maxNumRowEntriesFunctor, maxNumRowEntries_);
MueLu::DefaultLocalOrdinal LocalOrdinal
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_type
Lightweight MueLu representation of a compressed row storage graph.
Namespace for MueLu classes and methods.