10 #ifndef TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DEF_HPP
11 #define TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DEF_HPP
19 #include "Tpetra_Map.hpp"
20 #include "KokkosSparse_findRelOffset.hpp"
47 const row_offsets_type& ptr,
48 const lcl_col_inds_type& ind)
49 : OffRankOffsets_(OffRankOffsets)
50 , lclColMap_(lclColMap)
51 , lclDomMap_(lclDomMap)
54 typedef typename device_type::execution_space execution_space;
55 typedef Kokkos::RangePolicy<execution_space, LO> policy_type;
57 lclNumRows_ = ptr.extent(0) - 1;
58 policy_type range(0, ptr.extent(0));
59 Kokkos::parallel_for(range, *
this);
70 Tpetra::Details::OrdinalTraits<LO>::invalid();
72 if (lclRowInd == lclNumRows_)
73 OffRankOffsets_[lclRowInd] = ptr_[lclRowInd];
76 size_t offset = ptr_[lclRowInd + 1];
77 for (
size_t j = ptr_[lclRowInd]; j < ptr_[lclRowInd + 1]; j++) {
78 const LO lclColInd = ind_[j];
79 const GO gblColInd = lclColMap_.getGlobalElement(lclColInd);
80 const LO lclDomInd = lclDomMap_.getLocalElement(gblColInd);
81 if ((lclDomInd == INVALID) && (j < offset))
84 OffRankOffsets_[lclRowInd] = offset;
95 #define TPETRA_DETAILS_IMPL_GETGRAPHOFFRANKOFFSETS_INSTANT(LO, GO, NODE) \
96 template class Details::Impl::GetGraphOffRankOffsets<LO, GO, NODE::device_type>;
98 #endif // TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DEF_HPP
Import KokkosSparse::OrdinalTraits, a traits class for "invalid" (flag) values of integer types...
GetGraphOffRankOffsets(const offsets_type &OffRankOffsets, const local_map_type &lclColMap, const local_map_type &lclDomMap, const row_offsets_type &ptr, const lcl_col_inds_type &ind)
Constructor; also runs the functor.
KOKKOS_FUNCTION void operator()(const LO &lclRowInd) const
Kokkos::parallel_for loop body.