10 #ifndef MUELU_MATRIXCONSTRUCTION_HPP
11 #define MUELU_MATRIXCONSTRUCTION_HPP
13 #include "Kokkos_Core.hpp"
14 #include "Kokkos_ArithTraits.hpp"
20 #ifdef MUELU_COALESCE_DROP_DEBUG
25 namespace MueLu::MatrixConstruction {
36 template <
class local_matrix_type,
class functor_type,
class... remaining_functor_types>
44 using rowptr_type =
typename local_matrix_type::row_map_type::non_const_type;
53 #ifdef MUELU_COALESCE_DROP_DEBUG
54 std::string functorName;
65 #ifdef MUELU_COALESCE_DROP_DEBUG
66 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
68 char* demangledFunctorName = 0;
69 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
70 functorName = demangledFunctorName;
81 #ifdef MUELU_COALESCE_DROP_DEBUG
82 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
84 char* demangledFunctorName = 0;
85 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
86 functorName = demangledFunctorName;
90 KOKKOS_INLINE_FUNCTION
92 #ifdef MUELU_COALESCE_DROP_DEBUG
94 Kokkos::printf(
"\nStarting on row %d\n", rlid);
96 auto row =
A.rowConst(rlid);
98 Kokkos::printf(
"indices: ");
100 auto clid = row.colidx(k);
101 Kokkos::printf(
"%5d ", clid);
103 Kokkos::printf(
"\n");
105 Kokkos::printf(
"values: ");
107 auto val = row.value(k);
108 Kokkos::printf(
"%5f ", val);
110 Kokkos::printf(
"\n");
116 #ifdef MUELU_COALESCE_DROP_DEBUG
118 Kokkos::printf(
"%s\n", functorName.c_str());
120 auto row =
A.rowConst(rlid);
121 const size_t offset =
A.graph.row_map(rlid);
123 Kokkos::printf(
"decisions: ");
125 Kokkos::printf(
"%5d ",
results(offset + k));
127 Kokkos::printf(
"\n");
135 template <
class local_matrix_type,
class functor_type>
143 using rowptr_type =
typename local_matrix_type::row_map_type::non_const_type;
151 #ifdef MUELU_COALESCE_DROP_DEBUG
152 std::string functorName;
162 #ifdef MUELU_COALESCE_DROP_DEBUG
163 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
165 char* demangledFunctorName = 0;
166 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
167 functorName = demangledFunctorName;
177 #ifdef MUELU_COALESCE_DROP_DEBUG
178 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
180 char* demangledFunctorName = 0;
181 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
182 functorName = demangledFunctorName;
186 KOKKOS_INLINE_FUNCTION
188 #ifdef MUELU_COALESCE_DROP_DEBUG
190 Kokkos::printf(
"\nStarting on row %d\n", rlid);
192 auto row =
A.rowConst(rlid);
194 Kokkos::printf(
"indices: ");
196 auto clid = row.colidx(k);
197 Kokkos::printf(
"%5d ", clid);
199 Kokkos::printf(
"\n");
201 Kokkos::printf(
"values: ");
203 auto val = row.value(k);
204 Kokkos::printf(
"%5f ", val);
206 Kokkos::printf(
"\n");
212 #ifdef MUELU_COALESCE_DROP_DEBUG
213 Kokkos::printf(
"%s\n", functorName);
215 auto row =
A.rowConst(rlid);
216 const size_t offset =
A.graph.row_map(rlid);
218 Kokkos::printf(
"decisions: ");
220 Kokkos::printf(
"%5d ",
results(offset + k));
223 Kokkos::printf(
"\n");
224 Kokkos::printf(
"Done with row %d\n", rlid);
227 size_t start =
A.graph.row_map(rlid);
228 size_t end =
A.graph.row_map(rlid + 1);
229 for (
size_t i = start; i < end; ++i) {
247 template <
class local_matrix_type,
class local_graph_type,
bool lumping>
254 using ATS = Kokkos::ArithTraits<scalar_type>;
273 KOKKOS_INLINE_FUNCTION
275 auto rowA =
A.row(rlid);
276 size_t row_start =
A.graph.row_map(rlid);
284 if constexpr (lumping) {
291 rowFilteredA.colidx(j) = rowA.colidx(k);
292 rowFilteredA.value(j) = rowA.value(k);
294 graph.entries(graph_offset + jj) = rowA.colidx(k);
296 }
else if constexpr (lumping) {
297 diagCorrection += rowA.value(k);
298 rowFilteredA.colidx(j) = rowA.colidx(k);
299 rowFilteredA.value(j) =
zero;
302 rowFilteredA.colidx(j) = rowA.colidx(k);
303 rowFilteredA.value(j) =
zero;
307 if constexpr (lumping) {
308 rowFilteredA.value(diagOffset) += diagCorrection;
310 rowFilteredA.value(diagOffset) =
one;
326 template <
class local_matrix_type, lumpingType lumpingChoice>
333 using ATS = Kokkos::ArithTraits<scalar_type>;
350 KOKKOS_INLINE_FUNCTION
352 auto rowA =
A.row(rlid);
353 size_t K =
A.graph.row_map(rlid);
367 rowFilteredA.colidx(j) = rowA.colidx(k);
368 rowFilteredA.value(j) = rowA.value(k);
370 keptRowSumAbs += ATS::magnitude(rowFilteredA.value(j));
373 }
else if constexpr (lumpingChoice !=
no_lumping) {
374 droppedSum += rowA.value(k);
378 rowFilteredA.value(diagOffset) += droppedSum;
380 rowFilteredA.value(diagOffset) =
one;
382 if (ATS::real(droppedSum) >= ATS::real(
zero)) {
383 rowFilteredA.value(diagOffset) += droppedSum;
387 rowFilteredA.value(k) += droppedSum * ATS::magnitude(rowFilteredA.value(k)) / keptRowSumAbs;
394 template <
class local_matrix_type>
411 template <
class local_matrix_type2>
418 const local_matrix_type2
A;
423 KOKKOS_INLINE_FUNCTION
426 ,
offset(A_.graph.row_map(bsize_ * brlid_))
429 KOKKOS_INLINE_FUNCTION
437 KOKKOS_INLINE_FUNCTION
453 template <
class local_matrix_type,
455 class... remaining_functor_types>
465 using rowptr_type =
typename local_matrix_type::row_map_type::non_const_type;
466 using ATS = Kokkos::ArithTraits<local_ordinal_type>;
482 #ifdef MUELU_COALESCE_DROP_DEBUG
483 std::string functorName;
496 ,
remainingFunctors(A_, blockSize_, ghosted_point_to_block_, results_, filtered_rowptr_, graph_rowptr_, remainingFunctors_...) {
498 #ifdef MUELU_COALESCE_DROP_DEBUG
499 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
501 char* demangledFunctorName = 0;
502 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
503 functorName = demangledFunctorName;
507 KOKKOS_INLINE_FUNCTION
508 void join(Kokkos::pair<local_ordinal_type, local_ordinal_type>& dest,
const Kokkos::pair<local_ordinal_type, local_ordinal_type>& src)
const {
509 dest.first += src.first;
510 dest.second += src.second;
513 KOKKOS_INLINE_FUNCTION
519 KOKKOS_INLINE_FUNCTION
521 auto nnz_filtered = &nnz.first;
522 auto nnz_graph = &nnz.second;
524 #ifdef MUELU_COALESCE_DROP_DEBUG
525 Kokkos::printf(
"\nStarting on block row %d\n", brlid);
528 #ifdef MUELU_COALESCE_DROP_DEBUG
530 Kokkos::printf(
"\nStarting on row %d\n", rlid);
532 auto row =
A.rowConst(rlid);
534 Kokkos::printf(
"indices: ");
536 auto clid = row.colidx(k);
537 Kokkos::printf(
"%5d ", clid);
539 Kokkos::printf(
"\n");
541 Kokkos::printf(
"values: ");
543 auto val = row.value(k);
544 Kokkos::printf(
"%5f ", val);
546 Kokkos::printf(
"\n");
553 #ifdef MUELU_COALESCE_DROP_DEBUG
555 Kokkos::printf(
"%s\n", functorName.c_str());
557 auto row =
A.rowConst(rlid);
558 const size_t offset =
A.graph.row_map(rlid);
560 Kokkos::printf(
"decisions: ");
562 Kokkos::printf(
"%5d ",
results(offset + k));
564 Kokkos::printf(
"\n");
568 #ifdef MUELU_COALESCE_DROP_DEBUG
569 Kokkos::printf(
"Done with row %d\n", rlid);
572 size_t start =
A.graph.row_map(rlid);
573 size_t end =
A.graph.row_map(rlid + 1);
574 for (
size_t i = start; i < end; ++i) {
583 #ifdef MUELU_COALESCE_DROP_DEBUG
584 Kokkos::printf(
"Done with block row %d\nGraph indices ", brlid);
588 auto block_clids = Kokkos::subview(
A.graph.entries, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
591 auto block_permutation = Kokkos::subview(
permutation, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
593 for (
size_t i = 0; i < block_permutation.extent(0); ++i)
594 block_permutation(i) = i;
596 auto comparator =
comparison.getComparator(brlid);
600 bool alreadyAdded =
false;
603 auto offset =
A.graph.row_map(
blockSize * brlid);
604 for (
size_t i = 0; i < block_permutation.extent(0); ++i) {
605 auto idx = offset + block_permutation(i);
606 auto clid =
A.graph.entries(idx);
610 if (bclid > prev_bclid)
611 alreadyAdded =
false;
617 #ifdef MUELU_COALESCE_DROP_DEBUG
618 Kokkos::printf(
"%5d ", bclid);
623 #ifdef MUELU_COALESCE_DROP_DEBUG
624 Kokkos::printf(
"\n");
631 template <
class local_matrix_type,
642 using rowptr_type =
typename local_matrix_type::row_map_type::non_const_type;
643 using ATS = Kokkos::ArithTraits<local_ordinal_type>;
655 #ifdef MUELU_COALESCE_DROP_DEBUG
656 std::string functorName;
673 #ifdef MUELU_COALESCE_DROP_DEBUG
674 std::string mangledFunctorName =
typeid(decltype(
functor)).name();
676 char* demangledFunctorName = 0;
677 demangledFunctorName = abi::__cxa_demangle(mangledFunctorName.c_str(), 0, 0, &status);
678 functorName = demangledFunctorName;
682 KOKKOS_INLINE_FUNCTION
683 void join(Kokkos::pair<local_ordinal_type, local_ordinal_type>& dest,
const Kokkos::pair<local_ordinal_type, local_ordinal_type>& src)
const {
684 dest.first += src.first;
685 dest.second += src.second;
688 KOKKOS_INLINE_FUNCTION
693 KOKKOS_INLINE_FUNCTION
695 auto nnz_filtered = &nnz.first;
696 auto nnz_graph = &nnz.second;
698 #ifdef MUELU_COALESCE_DROP_DEBUG
699 Kokkos::printf(
"\nStarting on block row %d\n", brlid);
702 #ifdef MUELU_COALESCE_DROP_DEBUG
704 Kokkos::printf(
"\nStarting on row %d\n", rlid);
706 auto row =
A.rowConst(rlid);
708 Kokkos::printf(
"indices: ");
710 auto clid = row.colidx(k);
711 Kokkos::printf(
"%5d ", clid);
713 Kokkos::printf(
"\n");
715 Kokkos::printf(
"values: ");
717 auto val = row.value(k);
718 Kokkos::printf(
"%5f ", val);
720 Kokkos::printf(
"\n");
726 #ifdef MUELU_COALESCE_DROP_DEBUG
728 Kokkos::printf(
"%s\n", functorName.c_str());
730 auto row =
A.rowConst(rlid);
731 const size_t offset =
A.graph.row_map(rlid);
733 Kokkos::printf(
"decisions: ");
735 Kokkos::printf(
"%5d ",
results(offset + k));
737 Kokkos::printf(
"\n");
741 #ifdef MUELU_COALESCE_DROP_DEBUG
742 Kokkos::printf(
"Done with row %d\n", rlid);
745 size_t start =
A.graph.row_map(rlid);
746 size_t end =
A.graph.row_map(rlid + 1);
747 for (
size_t i = start; i < end; ++i) {
756 #ifdef MUELU_COALESCE_DROP_DEBUG
757 Kokkos::printf(
"Done with block row %d\nGraph indices ", brlid);
761 auto block_clids = Kokkos::subview(
A.graph.entries, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
764 auto block_permutation = Kokkos::subview(
permutation, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
766 for (
size_t i = 0; i < block_permutation.extent(0); ++i)
767 block_permutation(i) = i;
769 auto comparator =
comparison.getComparator(brlid);
773 bool alreadyAdded =
false;
776 auto offset =
A.graph.row_map(
blockSize * brlid);
777 for (
size_t i = 0; i < block_permutation.extent(0); ++i) {
778 auto idx = offset + block_permutation(i);
779 auto clid =
A.graph.entries(idx);
783 if (bclid > prev_bclid)
784 alreadyAdded =
false;
790 #ifdef MUELU_COALESCE_DROP_DEBUG
791 Kokkos::printf(
"%5d ", bclid);
796 #ifdef MUELU_COALESCE_DROP_DEBUG
797 Kokkos::printf(
"\n");
811 template <
class local_matrix_type,
bool lumping,
bool reuse>
819 using ATS = Kokkos::ArithTraits<scalar_type>;
820 using OTS = Kokkos::ArithTraits<local_ordinal_type>;
851 KOKKOS_INLINE_FUNCTION
854 auto rowA =
A.row(rlid);
855 size_t row_start =
A.graph.row_map(rlid);
861 if constexpr (lumping) {
868 rowFilteredA.colidx(j) = rowA.colidx(k);
869 rowFilteredA.value(j) = rowA.value(k);
871 }
else if constexpr (lumping) {
872 diagCorrection += rowA.value(k);
873 if constexpr (reuse) {
874 rowFilteredA.colidx(j) = rowA.colidx(k);
875 rowFilteredA.value(j) =
zero;
878 }
else if constexpr (reuse) {
879 rowFilteredA.colidx(j) = rowA.colidx(k);
880 rowFilteredA.value(j) =
zero;
884 if constexpr (lumping) {
885 rowFilteredA.value(diagOffset) += diagCorrection;
887 rowFilteredA.value(diagOffset) =
one;
892 auto block_clids = Kokkos::subview(
A.graph.entries, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
895 auto block_permutation = Kokkos::subview(
permutation, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
897 for (
size_t i = 0; i < block_permutation.extent(0); ++i)
898 block_permutation(i) = i;
900 auto comparator =
comparison.getComparator(brlid);
904 bool alreadyAdded =
false;
908 auto offset =
A.graph.row_map(
blockSize * brlid);
909 for (
size_t i = 0; i < block_permutation.extent(0); ++i) {
910 auto idx = offset + block_permutation(i);
911 auto clid =
A.graph.entries(idx);
915 if (bclid > prev_bclid)
916 alreadyAdded =
false;
920 graph.entries(j) = bclid;
929 template <
class local_matrix_type>
939 using rowptr_type =
typename local_matrix_type::row_map_type::non_const_type;
940 using ATS = Kokkos::ArithTraits<local_ordinal_type>;
960 KOKKOS_INLINE_FUNCTION
963 auto block_clids = Kokkos::subview(
A.graph.entries, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
966 auto block_permutation = Kokkos::subview(
permutation, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
968 for (
size_t i = 0; i < block_permutation.extent(0); ++i)
969 block_permutation(i) = i;
971 auto comparator =
comparison.getComparator(brlid);
975 bool alreadyAdded =
false;
978 auto offset =
A.graph.row_map(
blockSize * brlid);
979 for (
size_t i = 0; i < block_permutation.extent(0); ++i) {
980 auto idx = offset + block_permutation(i);
981 auto clid =
A.graph.entries(idx);
985 if (bclid > prev_bclid)
986 alreadyAdded =
false;
992 #ifdef MUELU_COALESCE_DROP_DEBUG
993 Kokkos::printf(
"%5d ", bclid);
998 #ifdef MUELU_COALESCE_DROP_DEBUG
999 Kokkos::printf(
"\n");
1006 template <
class local_matrix_type>
1014 using ATS = Kokkos::ArithTraits<scalar_type>;
1015 using OTS = Kokkos::ArithTraits<local_ordinal_type>;
1020 local_matrix_type
A;
1040 KOKKOS_INLINE_FUNCTION
1043 auto block_clids = Kokkos::subview(
A.graph.entries, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
1046 auto block_permutation = Kokkos::subview(
permutation, Kokkos::make_pair(
A.graph.row_map(
blockSize * brlid),
1048 for (
size_t i = 0; i < block_permutation.extent(0); ++i)
1049 block_permutation(i) = i;
1051 auto comparator =
comparison.getComparator(brlid);
1055 bool alreadyAdded =
false;
1059 auto offset =
A.graph.row_map(
blockSize * brlid);
1060 for (
size_t i = 0; i < block_permutation.extent(0); ++i) {
1061 auto idx = offset + block_permutation(i);
1062 auto clid =
A.graph.entries(idx);
1066 if (bclid > prev_bclid)
1067 alreadyAdded =
false;
1070 if (!alreadyAdded) {
1071 mergedA.graph.entries(j) = bclid;
1074 alreadyAdded =
true;
1081 template <
class local_matrix_type,
class local_graph_type>
1089 local_matrix_type
A;
1099 KOKKOS_INLINE_FUNCTION
1101 auto rowA =
A.row(rlid);
1102 size_t row_start =
A.graph.row_map(rlid);
1107 graph.entries(graph_offset + jj) = rowA.colidx(k);
typename local_matrix_type::ordinal_type local_ordinal_type
KOKKOS_INLINE_FUNCTION bool operator()(size_t x, size_t y) const
Kokkos::ArithTraits< local_ordinal_type > OTS
typename local_matrix_type::memory_space memory_space
typename ATS::magnitudeType magnitudeType
Kokkos::ArithTraits< scalar_type > ATS
typename local_matrix_type::memory_space memory_space
block_indices_view_type ghosted_point_to_block
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::memory_space memory_space
Kokkos::ArithTraits< local_ordinal_type > OTS
Comparator< local_matrix_type > comparator_type
Kokkos::View< local_ordinal_type *, memory_space > permutation_type
typename local_matrix_type::row_map_type::non_const_type rowptr_type
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_INLINE_FUNCTION void operatorRow(const local_ordinal_type rlid) const
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type rlid, local_ordinal_type &nnz, const bool &final) const
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_INLINE_FUNCTION void operatorRow(const local_ordinal_type rlid) const
typename local_matrix_type::row_map_type::non_const_type rowptr_type
typename local_matrix_type::memory_space memory_space
permutation_type permutation
KOKKOS_INLINE_FUNCTION comparator_type getComparator(local_ordinal_type brlid) const
magnitudeType dirichletThreshold
const local_matrix_type2 A
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type rlid) const
block_indices_view_type ghosted_point_to_block
Kokkos::View< DecisionType *, memory_space > results_view
const block_indices_view_type ghosted_point_to_block
magnitudeType dirichletThreshold
typename local_matrix_type::value_type scalar_type
PointwiseCountingFunctor(local_matrix_type &A_, results_view &results_, rowptr_type &rowptr_, functor_type &functor_)
permutation_type permutation
PointwiseCountingFunctor< local_matrix_type, remaining_functor_types...> remainingFunctors
KOKKOS_INLINE_FUNCTION void join(Kokkos::pair< local_ordinal_type, local_ordinal_type > &dest, const Kokkos::pair< local_ordinal_type, local_ordinal_type > &src) const
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::value_type scalar_type
rowptr_type filtered_rowptr
typename local_matrix_type::ordinal_type local_ordinal_type
local_ordinal_type blockSize
VectorCountingFunctor< local_matrix_type, remaining_functor_types...> remainingFunctors
typename local_matrix_type::memory_space memory_space
local_matrix_type filteredA
rowptr_type merged_rowptr
PointwiseCountingFunctor(local_matrix_type &A_, results_view &results_, rowptr_type &rowptr_, bool firstFunctor_, functor_type &functor_, remaining_functor_types &...remainingFunctors_)
Kokkos::View< local_ordinal_type *, memory_space > permutation_type
permutation_type permutation
Kokkos::ArithTraits< scalar_type > ATS
const local_ordinal_type offset
local_ordinal_type blockSize
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type brlid, Kokkos::pair< local_ordinal_type, local_ordinal_type > &nnz, const bool &final) const
BlockRowComparison< local_matrix_type > comparison
block_indices_view_type ghosted_point_to_block
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::value_type scalar_type
BlockRowComparison< local_matrix_type > comparison
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
typename local_matrix_type::value_type scalar_type
Kokkos::View< DecisionType *, memory_space > results_view
Kokkos::ArithTraits< local_ordinal_type > ATS
typename local_matrix_type::memory_space memory_space
BlockRowComparison< local_matrix_type > comparison
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::row_map_type::non_const_type rowptr_type
Kokkos::ArithTraits< local_ordinal_type > ATS
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::memory_space memory_space
PointwiseFillNoReuseFunctor(local_matrix_type &A_, results_view &results_, local_matrix_type &filteredA_, magnitudeType dirichletThreshold_)
typename local_matrix_type::row_map_type::non_const_type rowptr_type
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type rlid) const
rowptr_type filtered_rowptr
KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type &v, comparator_type comparator)
typename local_matrix_type::value_type scalar_type
VectorCountingFunctor(local_matrix_type &A_, local_ordinal_type blockSize_, block_indices_view_type ghosted_point_to_block_, results_view &results_, rowptr_type &filtered_rowptr_, rowptr_type &graph_rowptr_, functor_type &functor_, remaining_functor_types &...remainingFunctors_)
typename ATS::magnitudeType magnitudeType
Functor that executes a sequence of sub-functors on each block of rows.
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::ArithTraits< scalar_type > ATS
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::ArithTraits< scalar_type > ATS
PointwiseCountingFunctor(local_matrix_type &A_, results_view &results_, rowptr_type &rowptr_, functor_type &functor_, remaining_functor_types &...remainingFunctors_)
VectorFillFunctor(local_matrix_type &A_, local_ordinal_type blockSize_, block_indices_view_type ghosted_point_to_block_, results_view &results_, local_matrix_type &filteredA_, local_graph_type &graph_, magnitudeType dirichletThreshold_)
block_indices_view_type ghosted_point_to_block
PointwiseCountingFunctor(local_matrix_type &A_, results_view &results_, rowptr_type &rowptr_, bool firstFunctor_, functor_type &functor_)
Kokkos::View< local_ordinal_type *, memory_space > permutation_type
typename local_matrix_type::memory_space memory_space
Functor that fills the filtered matrix while reusing the graph of the matrix before dropping...
local_ordinal_type blockSize
block_indices_view_type ghosted_point_to_block
Kokkos::ArithTraits< local_ordinal_type > ATS
typename local_matrix_type::ordinal_type local_ordinal_type
PointwiseFillReuseFunctor(local_matrix_type &A_, results_view &results_, local_matrix_type &filteredA_, local_graph_type &graph_, magnitudeType dirichletThreshold_)
MergeCountFunctor(local_matrix_type &A_, local_ordinal_type blockSize_, block_indices_view_type ghosted_point_to_block_, rowptr_type &merged_rowptr_)
Functor that executes a sequence of sub-functors on each row for a problem with blockSize == 1...
Kokkos::View< DecisionType *, memory_space > results_view
local_ordinal_type blockSize
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type2::ordinal_type local_ordinal_type
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type rlid) const
magnitudeType dirichletThreshold
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type brlid, Kokkos::pair< local_ordinal_type, local_ordinal_type > &nnz, const bool &final) const
typename local_matrix_type::ordinal_type local_ordinal_type
local_ordinal_type blockSize
KOKKOS_INLINE_FUNCTION Comparator(const local_matrix_type2 &A_, local_ordinal_type bsize_, local_ordinal_type brlid_, block_indices_view_type ghosted_point_to_block_)
typename local_matrix_type::value_type scalar_type
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type rlid, local_ordinal_type &nnz, const bool &final) const
Kokkos::View< local_ordinal_type *, memory_space > permutation_type
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type brlid, local_ordinal_type &nnz_graph, const bool &final) const
typename local_matrix_type::row_map_type::non_const_type rowptr_type
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::memory_space memory_space
typename ATS::magnitudeType magnitudeType
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::value_type scalar_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
VectorCountingFunctor(local_matrix_type &A_, local_ordinal_type blockSize_, block_indices_view_type ghosted_point_to_block_, results_view &results_, rowptr_type &filtered_rowptr_, rowptr_type &graph_rowptr_, functor_type &functor_)
typename local_matrix_type::staticcrsgraph_type local_graph_type
Functor does not reuse the graph of the matrix for a problem with blockSize == 1. ...
typename ATS::magnitudeType magnitudeType
local_matrix_type filteredA
BlockRowComparison< local_matrix_type > comparison
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type brlid) const
block_indices_view_type ghosted_point_to_block
BlockRowComparison(local_matrix_type &A_, local_ordinal_type bsize_, block_indices_view_type ghosted_point_to_block_)
Kokkos::View< DecisionType *, memory_space > results_view
BlockRowComparison< local_matrix_type > comparison
typename local_matrix_type2::memory_space memory_space
permutation_type permutation
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
permutation_type permutation
Kokkos::View< local_ordinal_type *, memory_space > permutation_type
GraphConstruction(local_matrix_type &A_, results_view &results_, local_graph_type &graph_)
KOKKOS_INLINE_FUNCTION void operator()(const local_ordinal_type brlid) const
typename local_matrix_type::ordinal_type local_ordinal_type
local_matrix_type mergedA
MergeFillFunctor(local_matrix_type &A_, local_ordinal_type blockSize_, block_indices_view_type ghosted_point_to_block_, local_matrix_type &mergedA_)
local_matrix_type filteredA
Kokkos::View< DecisionType *, memory_space > results_view
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
KOKKOS_INLINE_FUNCTION void join(Kokkos::pair< local_ordinal_type, local_ordinal_type > &dest, const Kokkos::pair< local_ordinal_type, local_ordinal_type > &src) const
typename local_matrix_type::staticcrsgraph_type local_graph_type