44 #ifndef TPETRA_DETAILS_GETGRAPHDIAGOFFSETS_DEF_HPP 45 #define TPETRA_DETAILS_GETGRAPHDIAGOFFSETS_DEF_HPP 53 #include "Tpetra_Map.hpp" 54 #include "Kokkos_Sparse_findRelOffset.hpp" 81 const row_offsets_type& ptr,
82 const lcl_col_inds_type& ind,
83 const bool isSorted) :
84 diagOffsets_ (diagOffsets),
85 lclRowMap_ (lclRowMap),
86 lclColMap_ (lclColMap),
91 typedef typename device_type::execution_space execution_space;
92 typedef Kokkos::RangePolicy<execution_space, LO> policy_type;
95 policy_type range (0, lclNumRows);
96 Kokkos::parallel_for (range, *
this);
102 class DiagOffsetType>
108 Tpetra::Details::OrdinalTraits<diag_offset_type>::invalid ();
110 const GO gblColInd = gblRowInd;
113 if (lclColInd == Tpetra::Details::OrdinalTraits<LO>::invalid ()) {
114 diagOffsets_[lclRowInd] = STINV;
118 const LO numEnt = ptr_[lclRowInd+1] - ptr_[lclRowInd];
122 Kokkos::subview (ind_, Kokkos::make_pair (ptr_[lclRowInd],
124 using ::KokkosSparse::findRelOffset;
125 const LO diagOffset =
126 findRelOffset<LO, lcl_col_inds_type> (lclColInds, numEnt,
127 lclColInd, 0, isSorted_);
128 diagOffsets_[lclRowInd] = (diagOffset == numEnt) ? STINV :
129 static_cast<diag_offset_type> (diagOffset);
140 #define TPETRA_DETAILS_IMPL_GETGRAPHDIAGOFFSETS_INSTANT( LO, GO, NODE ) \ 141 template class Details::Impl::GetGraphDiagOffsets< LO, GO, NODE::device_type >; 143 #endif // TPETRA_DETAILS_GETGRAPHDIAGOFFSETS_DEF_HPP Namespace Tpetra contains the class and methods constituting the Tpetra library.
Import KokkosSparse::OrdinalTraits, a traits class for "invalid" (flag) values of integer types...
Implementation details of Tpetra.
KOKKOS_FUNCTION void operator()(const LO &lclRowInd) const
Kokkos::parallel_for loop body.
KOKKOS_INLINE_FUNCTION LocalOrdinal getLocalElement(const GlobalOrdinal globalIndex) const
Get the local index corresponding to the given global index.
KOKKOS_INLINE_FUNCTION GlobalOrdinal getGlobalElement(const LocalOrdinal localIndex) const
Get the global index corresponding to the given local index.
GetGraphDiagOffsets(const diag_offsets_type &diagOffsets, const local_map_type &lclRowMap, const local_map_type &lclColMap, const row_offsets_type &ptr, const lcl_col_inds_type &ind, const bool isSorted)
Constructor; also runs the functor.
KOKKOS_INLINE_FUNCTION LocalOrdinal getNodeNumElements() const
The number of indices that live on the calling process.