46#ifndef MUELU_LOCALLWGRAPH_KOKKOS_DEF_HPP
47#define MUELU_LOCALLWGRAPH_KOKKOS_DEF_HPP
49#include <Kokkos_Core.hpp>
51#include <Teuchos_ArrayView.hpp>
59 template<
class LocalOrdinal,
class RowType>
60 class MaxNumRowEntriesFunctor {
62 MaxNumRowEntriesFunctor(RowType rowPointers) :
rowPointers_(rowPointers) { }
64 KOKKOS_INLINE_FUNCTION
65 void operator()(
const LocalOrdinal i,
size_t& maxLength)
const {
68 maxLength = (d > maxLength ? d : maxLength);
71 KOKKOS_INLINE_FUNCTION
72 void join(
volatile size_t& dest,
const volatile size_t& src) {
73 dest = (dest > src ? dest : src);
76 KOKKOS_INLINE_FUNCTION
77 void init(
size_t& initValue) {
87 template<
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
90 const RCP<const map_type>& domainMap)
93 minLocalIndex_ = domainMap->getMinLocalIndex();
94 maxLocalIndex_ = domainMap->getMaxLocalIndex();
96 MaxNumRowEntriesFunctor<LO,typename local_graph_type::row_map_type> maxNumRowEntriesFunctor(graph_.row_map);
97 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.