10 #ifndef MUELU_COALESCEDROPFACTORY_KOKKOS_DEF_HPP
11 #define MUELU_COALESCEDROPFACTORY_KOKKOS_DEF_HPP
13 #include <Kokkos_Core.hpp>
14 #include <KokkosSparse_CrsMatrix.hpp>
20 #include "MueLu_AmalgamationInfo.hpp"
23 #include "MueLu_LWGraph_kokkos.hpp"
26 #include "MueLu_Utilities.hpp"
30 namespace CoalesceDrop_Kokkos_Details {
32 template <
class LO,
class RowType>
38 KOKKOS_INLINE_FUNCTION
49 template <
class LO,
class GhostedViewType>
52 typedef typename GhostedViewType::value_type
SC;
53 typedef Kokkos::ArithTraits<SC>
ATS;
65 KOKKOS_FORCEINLINE_FUNCTION
68 auto aiiajj = ATS::magnitude(
diag(row, 0)) * ATS::magnitude(
diag(col, 0));
69 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
71 return (aij2 <=
eps *
eps * aiiajj);
75 template <
class LO,
class CoordsType>
78 typedef typename CoordsType::value_type
SC;
79 typedef Kokkos::ArithTraits<SC>
ATS;
89 KOKKOS_INLINE_FUNCTION
91 SC d = ATS::zero(), s;
92 for (
size_t j = 0; j <
coords.extent(1); j++) {
96 return ATS::magnitude(d);
103 template <
class LO,
class GhostedViewType,
class DistanceFunctor>
106 typedef typename GhostedViewType::value_type
SC;
107 typedef Kokkos::ArithTraits<SC>
ATS;
112 :
diag(ghostedLaplDiag)
117 KOKKOS_INLINE_FUNCTION
124 typedef Kokkos::ArithTraits<dSC> dATS;
127 auto aiiajj = ATS::magnitude(
diag(row, 0)) * ATS::magnitude(
diag(col, 0));
128 auto aij2 = ATS::magnitude(fval) * ATS::magnitude(fval);
130 return (aij2 <=
eps *
eps * aiiajj);
139 template <
class SC,
class LO,
class MatrixType,
class BndViewType,
class DropFunctorType>
146 typedef Kokkos::ArithTraits<SC>
ATS;
152 ScalarFunctor(MatrixType A_, BndViewType bndNodes_, DropFunctorType dropFunctor_,
153 typename rows_type::non_const_type rows_,
154 typename cols_type::non_const_type colsAux_,
155 typename vals_type::non_const_type valsAux_,
156 bool reuseGraph_,
bool lumping_,
SC ,
157 bool aggregationMayCreateDirichlet_)
168 zero = impl_ATS::zero();
171 KOKKOS_INLINE_FUNCTION
173 auto rowView =
A.rowConst(row);
174 auto length = rowView.length;
175 auto offset =
rowsA(row);
180 for (decltype(length) colID = 0; colID < length; colID++) {
181 LO col = rowView.colidx(colID);
185 colsAux(offset + rownnz) = col;
202 rows(row + 1) = rownnz;
210 valsAux(offset + diagID) += diag;
231 typename rows_type::non_const_type
rows;
242 template <
class MatrixType,
class NnzType,
class blkSizeType>
245 typedef typename MatrixType::ordinal_type
LO;
253 KOKKOS_INLINE_FUNCTION
257 LO nodeRowMaxNonZeros = 0;
260 nodeRowMaxNonZeros += rowView.length;
262 nnz(row + 1) = nodeRowMaxNonZeros;
263 totalnnz += nodeRowMaxNonZeros;
276 template <
class MatrixType,
class NnzType,
class blkSizeType,
class ColDofType,
class Dof2NodeTranslationType,
class BdryNodeTypeConst,
class BdryNodeType,
class boolType>
279 typedef typename MatrixType::ordinal_type
LO;
295 blkSizeType blkSize_,
297 Dof2NodeTranslationType dof2node_,
299 BdryNodeTypeConst dirichletdof_,
300 BdryNodeType bdrynode_,
301 boolType usegreedydirichlet_)
313 KOKKOS_INLINE_FUNCTION
320 auto numIndices = rowView.length;
326 for (decltype(numIndices) k = 0; k < numIndices; k++) {
327 auto dofID = rowView.colidx(k);
336 auto numIndices = rowView.length;
342 for (decltype(numIndices) k = 0; k < numIndices; k++) {
343 auto dofID = rowView.colidx(k);
354 for (
LO i = 0; i < (n - 1); i++) {
355 for (
LO j = 0; j < (n - i - 1); j++) {
365 for (
LO i = 0; i < n; i++) {
368 if (nodeID != lastNodeID) {
380 template <
class MatrixType,
class ColDofNnzType,
class ColDofType,
class ColNodeNnzType,
class ColNodeType>
383 typedef typename MatrixType::ordinal_type
LO;
384 typedef typename MatrixType::value_type
SC;
393 Stage1dVectorFunctor(ColDofType coldofs_, ColDofNnzType coldofnnz_, ColNodeType colnodes_, ColNodeNnzType colnodennz_)
400 KOKKOS_INLINE_FUNCTION
405 auto n = nodeend - nodebegin;
407 for (decltype(nodebegin) i = 0; i < n; i++) {
415 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
419 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
432 #undef SET_VALID_ENTRY
434 validParamList->
set<
RCP<const FactoryBase>>(
"UnAmalgamationInfo", Teuchos::null,
"Generating factory for UnAmalgamationInfo");
437 return validParamList;
440 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
442 Input(currentLevel,
"A");
443 Input(currentLevel,
"UnAmalgamationInfo");
446 if (pL.
get<std::string>(
"aggregation: drop scheme") ==
"distance laplacian")
447 Input(currentLevel,
"Coordinates");
450 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
456 typedef typename STS::magnitudeType MT;
459 auto A = Get<RCP<Matrix>>(currentLevel,
"A");
479 LO blkSize = A->GetFixedBlockSize() / A->GetStorageBlockSize();
481 auto amalInfo = Get<RCP<AmalgamationInfo>>(currentLevel,
"UnAmalgamationInfo");
486 TEUCHOS_TEST_FOR_EXCEPTION(pL.get<
bool>(
"aggregation: use ml scaling of drop tol"), std::invalid_argument,
"Option: 'aggregation: use ml scaling of drop tol' is not supported in the Kokkos version of CoalesceDroPFactory");
488 std::string algo = pL.get<std::string>(
"aggregation: drop scheme");
490 double threshold = pL.get<
double>(
"aggregation: drop tol");
491 GetOStream(
Runtime0) <<
"algorithm = \"" << algo <<
"\": threshold = " << threshold
492 <<
", blocksize = " << A->GetFixedBlockSize() << std::endl;
494 const typename STS::magnitudeType dirichletThreshold =
495 STS::magnitude(as<SC>(pL.get<
double>(
"aggregation: Dirichlet threshold")));
497 GO numDropped = 0, numTotal = 0;
503 boundary_nodes_type boundaryNodes;
506 if (blkSize == 1 && threshold == zero) {
513 graph =
rcp(
new LWGraph_kokkos(A->getCrsGraph()->getLocalGraphDevice(), A->getRowMap(), A->getColMap(),
"graph of A"));
516 numTotal = A->getLocalNumEntries();
521 }
else if (blkSize == 1 && threshold != zero) {
527 typedef typename Matrix::local_matrix_type local_matrix_type;
529 typedef typename kokkos_graph_type::row_map_type::non_const_type rows_type;
530 typedef typename kokkos_graph_type::entries_type::non_const_type cols_type;
531 typedef typename local_matrix_type::values_type::non_const_type vals_type;
533 LO numRows = A->getLocalNumRows();
534 local_matrix_type kokkosMatrix = A->getLocalMatrixDevice();
535 auto nnzA = kokkosMatrix.nnz();
536 auto rowsA = kokkosMatrix.graph.row_map;
538 typedef Kokkos::ArithTraits<SC> ATS;
539 typedef typename ATS::val_type impl_Scalar;
540 typedef Kokkos::ArithTraits<impl_Scalar> impl_ATS;
542 bool reuseGraph = pL.get<
bool>(
"filtered matrix: reuse graph");
543 bool lumping = pL.get<
bool>(
"filtered matrix: use lumping");
545 GetOStream(
Runtime0) <<
"Lumping dropped entries" << std::endl;
547 const bool aggregationMayCreateDirichlet = pL.get<
bool>(
"aggregation: dropping may create Dirichlet");
550 rows_type
rows(
"FA_rows", numRows + 1);
551 cols_type
colsAux(Kokkos::ViewAllocateWithoutInitializing(
"FA_aux_cols"), nnzA);
557 filteredA = MatrixFactory::Build(A->getCrsGraph());
561 fillCompleteParams->set(
"No Nonlocal Changes",
true);
562 filteredA->fillComplete(fillCompleteParams);
565 valsAux = filteredA->getLocalMatrixDevice().values;
569 valsAux = vals_type(Kokkos::ViewAllocateWithoutInitializing(
"FA_aux_vals"), nnzA);
574 if (algo ==
"classical") {
578 kokkosMatrix = local_matrix_type();
581 kokkosMatrix = A->getLocalMatrixDevice();
588 auto ghostedDiagView = ghostedDiag->getDeviceLocalView(Xpetra::Access::ReadWrite);
592 scalarFunctor(kokkosMatrix, boundaryNodes, dropFunctor, rows, colsAux, valsAux, reuseGraph, lumping, threshold, aggregationMayCreateDirichlet);
594 Kokkos::parallel_reduce(
"MueLu:CoalesceDropF:Build:scalar_filter:main_loop",
range_type(0, numRows),
595 scalarFunctor, nnzFA);
598 }
else if (algo ==
"distance laplacian") {
600 auto coords = Get<RCP<doubleMultiVector>>(currentLevel,
"Coordinates");
602 auto uniqueMap = A->getRowMap();
603 auto nonUniqueMap = A->getColMap();
609 importer = ImportFactory::Build(uniqueMap, nonUniqueMap);
618 auto ghostedCoordsView = ghostedCoords->getDeviceLocalView(Xpetra::Access::ReadWrite);
626 localLaplDiag = VectorFactory::Build(uniqueMap);
628 auto localLaplDiagView = localLaplDiag->getDeviceLocalView(Xpetra::Access::OverwriteAll);
629 auto kokkosGraph = kokkosMatrix.graph;
631 Kokkos::parallel_for(
632 "MueLu:CoalesceDropF:Build:scalar_filter:laplacian_diag",
range_type(0, numRows),
633 KOKKOS_LAMBDA(
const LO row) {
634 auto rowView = kokkosGraph.rowConst(row);
635 auto length = rowView.length;
637 impl_Scalar d = impl_ATS::zero();
638 for (decltype(length) colID = 0; colID < length; colID++) {
639 auto col = rowView(colID);
641 d += impl_ATS::one() / distFunctor.
distance2(row, col);
643 localLaplDiagView(row, 0) = d;
650 SubFactoryMonitor m2(*
this,
"Ghosted Laplacian diag construction", currentLevel);
651 ghostedLaplDiag = VectorFactory::Build(nonUniqueMap);
652 ghostedLaplDiag->doImport(*localLaplDiag, *importer,
Xpetra::INSERT);
659 auto ghostedLaplDiagView = ghostedLaplDiag->getDeviceLocalView(Xpetra::Access::ReadWrite);
662 dropFunctor(ghostedLaplDiagView, distFunctor, threshold);
664 scalarFunctor(kokkosMatrix, boundaryNodes, dropFunctor, rows, colsAux, valsAux, reuseGraph, lumping, threshold,
true);
666 Kokkos::parallel_reduce(
"MueLu:CoalesceDropF:Build:scalar_filter:main_loop",
range_type(0, numRows),
667 scalarFunctor, nnzFA);
671 numDropped = nnzA - nnzFA;
677 Kokkos::parallel_scan(
678 "MueLu:CoalesceDropF:Build:scalar_filter:compress_rows",
range_type(0, numRows + 1),
679 KOKKOS_LAMBDA(
const LO i,
LO& update,
const bool& final_pass) {
691 cols_type cols(Kokkos::ViewAllocateWithoutInitializing(
"FA_cols"), nnzFA);
694 GetOStream(
Runtime1) <<
"reuse matrix graph for filtering (compress matrix columns only)" << std::endl;
698 Kokkos::parallel_for(
699 "MueLu:TentativePF:Build:compress_cols",
range_type(0, numRows),
700 KOKKOS_LAMBDA(
const LO i) {
703 LO rowAStart = rowsA(i);
704 size_t rownnz =
rows(i + 1) -
rows(i);
705 for (
size_t j = 0; j < rownnz; j++)
706 cols(rowStart + j) =
colsAux(rowAStart + j);
710 GetOStream(
Runtime1) <<
"new matrix graph for filtering (compress matrix columns and values)" << std::endl;
713 vals = vals_type(Kokkos::ViewAllocateWithoutInitializing(
"FA_vals"), nnzFA);
715 Kokkos::parallel_for(
716 "MueLu:TentativePF:Build:compress_cols",
range_type(0, numRows),
717 KOKKOS_LAMBDA(
const LO i) {
719 LO rowAStart = rowsA(i);
720 size_t rownnz =
rows(i + 1) -
rows(i);
721 for (
size_t j = 0; j < rownnz; j++) {
722 cols(rowStart + j) =
colsAux(rowAStart + j);
723 vals(rowStart + j) =
valsAux(rowAStart + j);
728 kokkos_graph_type kokkosGraph(cols, rows);
733 graph =
rcp(
new LWGraph_kokkos(kokkosGraph, A->getRowMap(), A->getColMap(),
"filtered graph of A"));
737 numTotal = A->getLocalNumEntries();
744 local_matrix_type localFA = local_matrix_type(
"A", numRows, A->getLocalMatrixDevice().numCols(), nnzFA, vals,
rows, cols);
745 auto filteredACrs = CrsMatrixFactory::Build(localFA, A->getRowMap(), A->getColMap(), A->getDomainMap(), A->getRangeMap(),
746 A->getCrsGraph()->getImporter(), A->getCrsGraph()->getExporter());
747 filteredA =
rcp(
new CrsMatrixWrap(filteredACrs));
750 filteredA->SetFixedBlockSize(A->GetFixedBlockSize());
752 if (pL.get<
bool>(
"filtered matrix: reuse eigenvalue")) {
757 filteredA->SetMaxEigenvalueEstimate(A->GetMaxEigenvalueEstimate());
762 }
else if (blkSize > 1 && threshold == zero) {
781 Array<LO> rowTranslationArray = *(amalInfo->getRowTranslation());
782 Array<LO> colTranslationArray = *(amalInfo->getColTranslation());
784 Kokkos::View<LO*, Kokkos::MemoryUnmanaged>
785 rowTranslationView(rowTranslationArray.
getRawPtr(), rowTranslationArray.
size());
786 Kokkos::View<LO*, Kokkos::MemoryUnmanaged>
787 colTranslationView(colTranslationArray.
getRawPtr(), colTranslationArray.
size());
790 LO numNodes = Teuchos::as<LocalOrdinal>(uniqueMap->getLocalNumElements());
791 typedef typename Kokkos::View<LocalOrdinal*, typename Node::device_type> id_translation_type;
792 id_translation_type rowTranslation(
"dofId2nodeId", rowTranslationArray.
size());
793 id_translation_type colTranslation(
"ov_dofId2nodeId", colTranslationArray.
size());
794 Kokkos::deep_copy(rowTranslation, rowTranslationView);
795 Kokkos::deep_copy(colTranslation, colTranslationView);
798 blkSize = A->GetFixedBlockSize();
801 if (A->IsView(
"stridedMaps") ==
true) {
805 blkSize = Teuchos::as<const LocalOrdinal>(strMap->getFixedBlockSize());
806 blkId = strMap->getStridedBlockId();
808 blkPartSize = Teuchos::as<LocalOrdinal>(strMap->getStridingData()[blkId]);
810 auto kokkosMatrix = A->getLocalMatrixDevice();
814 typedef typename kokkos_graph_type::row_map_type row_map_type;
816 typedef typename kokkos_graph_type::entries_type entries_type;
819 typename row_map_type::non_const_type dofNnz(
"nnz_map", numNodes + 1);
822 Kokkos::parallel_reduce(
"MueLu:CoalesceDropF:Build:scalar_filter:stage1a",
range_type(0, numNodes), stage1aFunctor, numDofCols);
825 Kokkos::parallel_scan(
"MueLu:CoalesceDropF:Build:scalar_filter:stage1_scan",
range_type(0, numNodes + 1), scanFunctor);
830 typename entries_type::non_const_type dofcols(
"dofcols", numDofCols );
834 typename row_map_type::non_const_type
rows(
"nnz_nodemap", numNodes + 1);
835 typename boundary_nodes_type::non_const_type bndNodes(
"boundaryNodes", numNodes);
837 CoalesceDrop_Kokkos_Details::Stage1bcVectorFunctor<decltype(kokkosMatrix), decltype(dofNnz), decltype(blkPartSize), decltype(dofcols), decltype(colTranslation), decltype(singleEntryRows), decltype(bndNodes), bool> stage1bcFunctor(kokkosMatrix, dofNnz, blkPartSize, dofcols, colTranslation, rows, singleEntryRows, bndNodes, pL.get<
bool>(
"aggregation: greedy Dirichlet"));
838 Kokkos::parallel_reduce(
"MueLu:CoalesceDropF:Build:scalar_filter:stage1c",
range_type(0, numNodes), stage1bcFunctor, numNodeCols);
842 Kokkos::parallel_scan(
"MueLu:CoalesceDropF:Build:scalar_filter:stage1_scan",
range_type(0, numNodes + 1), scanNodeFunctor);
845 typename entries_type::non_const_type cols(
"nodecols", numNodeCols);
848 Kokkos::parallel_for(
"MueLu:CoalesceDropF:Build:scalar_filter:stage1c",
range_type(0, numNodes), stage1dFunctor);
849 kokkos_graph_type kokkosGraph(cols, rows);
852 graph =
rcp(
new LWGraph_kokkos(kokkosGraph, uniqueMap, nonUniqueMap,
"amalgamated graph of A"));
854 boundaryNodes = bndNodes;
856 numTotal = A->getLocalNumEntries();
858 dofsPerNode = blkSize;
867 GO numLocalBoundaryNodes = 0;
868 GO numGlobalBoundaryNodes = 0;
870 Kokkos::parallel_reduce(
871 "MueLu:CoalesceDropF:Build:bnd",
range_type(0, boundaryNodes.extent(0)),
872 KOKKOS_LAMBDA(
const LO i,
GO& n) {
873 if (boundaryNodes(i))
876 numLocalBoundaryNodes);
878 auto comm = A->getRowMap()->getComm();
879 MueLu_sumAll(comm, numLocalBoundaryNodes, numGlobalBoundaryNodes);
880 GetOStream(
Statistics1) <<
"Detected " << numGlobalBoundaryNodes <<
" Dirichlet nodes" << std::endl;
883 if ((GetVerbLevel() &
Statistics1) && threshold != zero) {
884 auto comm = A->getRowMap()->getComm();
886 GO numGlobalTotal, numGlobalDropped;
890 if (numGlobalTotal != 0) {
891 GetOStream(
Statistics1) <<
"Number of dropped entries: "
892 << numGlobalDropped <<
"/" << numGlobalTotal
893 <<
" (" << 100 * Teuchos::as<double>(numGlobalDropped) / Teuchos::as<double>(numGlobalTotal) <<
"%)" << std::endl;
897 Set(currentLevel,
"DofsPerNode", dofsPerNode);
898 Set(currentLevel,
"Graph", graph);
899 Set(currentLevel,
"A", filteredA);
902 #endif // MUELU_COALESCEDROPFACTORY_KOKKOS_DEF_HPP
bool aggregationMayCreateDirichlet
Dof2NodeTranslationType dof2node
KOKKOS_INLINE_FUNCTION void operator()(const LO rowNode) const
#define MueLu_sumAll(rcpComm, in, out)
MueLu::DefaultLocalOrdinal LocalOrdinal
DropFunctorType dropFunctor
KOKKOS_INLINE_FUNCTION void operator()(const LO row, LO &nnz) const
Lightweight MueLu representation of a compressed row storage graph.
Stage1dVectorFunctor(ColDofType coldofs_, ColDofNnzType coldofnnz_, ColNodeType colnodes_, ColNodeNnzType colnodennz_)
ScalarFunctor(MatrixType A_, BndViewType bndNodes_, DropFunctorType dropFunctor_, typename rows_type::non_const_type rows_, typename cols_type::non_const_type colsAux_, typename vals_type::non_const_type valsAux_, bool reuseGraph_, bool lumping_, SC, bool aggregationMayCreateDirichlet_)
KOKKOS_INLINE_FUNCTION void SetBoundaryNodeMap(const boundary_nodes_type bndry)
Set boolean array indicating which rows correspond to Dirichlet boundaries.
graph_type::entries_type cols_type
Stage1aVectorFunctor(MatrixType kokkosMatrix_, NnzType nnz_, blkSizeType blkSize_)
BdryNodeTypeConst dirichletdof
ATS::val_type impl_Scalar
typename std::conditional< OnHost, typename local_graph_device_type::HostMirror, local_graph_device_type >::type local_graph_type
void setValidator(RCP< const ParameterEntryValidator > const &validator)
MatrixType::value_type SC
T & get(const std::string &name, T def_value)
KOKKOS_FORCEINLINE_FUNCTION bool operator()(LO row, LO col, SC val) const
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
ClassicalDropFunctor(GhostedViewType ghostedDiag, magnitudeType threshold)
graph_type::row_map_type rows_type
KOKKOS_INLINE_FUNCTION magnitudeType distance2(LO row, LO col) const
One-liner description of what is happening.
ScanFunctor(RowType rows_)
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
KOKKOS_INLINE_FUNCTION void operator()(const LO i, LO &upd, const bool &final) const
GhostedViewType::value_type SC
Kokkos::View< bool *, memory_space > boundary_nodes_type
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
ATS::magnitudeType magnitudeType
Class that holds all level-specific information.
KOKKOS_INLINE_FUNCTION bool operator()(LO row, LO col, SC) const
MatrixType::ordinal_type LO
Timer to be used in factories. Similar to SubMonitor but adds a timer level by level.
DistanceLaplacianDropFunctor(GhostedViewType ghostedLaplDiag, DistanceFunctor distFunctor_, magnitudeType threshold)
GhostedViewType::value_type SC
void DeclareInput(Level ¤tLevel) const
Input.
KOKKOS_INLINE_FUNCTION void operator()(const LO row, LO &totalnnz) const
DistanceFunctor distFunctor
Kokkos::ArithTraits< SC > ATS
Stage1bcVectorFunctor(MatrixType kokkosMatrix_, NnzType coldofnnz_, blkSizeType blkSize_, ColDofType coldofs_, Dof2NodeTranslationType dof2node_, NnzType colnodennz_, BdryNodeTypeConst dirichletdof_, BdryNodeType bdrynode_, boolType usegreedydirichlet_)
static RCP< Vector > GetMatrixOverlappedDiagonal(const Matrix &A)
Extract Overlapped Matrix Diagonal.
ATS::magnitudeType magnitudeType
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
MatrixType::StaticCrsGraphType graph_type
vals_type::non_const_type valsAux
boolType usegreedydirichlet
MatrixType::ordinal_type LO
Kokkos::ArithTraits< SC > ATS
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Build(Level ¤tLevel) const
Build an object with this factory.
MatrixType::values_type vals_type
#define SET_VALID_ENTRY(name)
ATS::magnitudeType magnitudeType
Kokkos::ArithTraits< impl_Scalar > impl_ATS
cols_type::non_const_type colsAux
Exception throws to report errors in the internal logical of the program.
Kokkos::ArithTraits< SC > ATS
Description of what is happening (more verbose)
Kokkos::ArithTraits< SC > ATS
ParameterEntry & getEntry(const std::string &name)
DistanceFunctor(CoordsType coords_)
static Kokkos::View< bool *, typename NO::device_type::memory_space > DetectDirichletRows_kokkos(const Matrix &A, const Magnitude &tol=Teuchos::ScalarTraits< typename Teuchos::ScalarTraits< SC >::magnitudeType >::zero(), const bool count_twos_as_dirichlet=false)
Detect Dirichlet rows.
ATS::magnitudeType magnitudeType
ColNodeNnzType colnodennz
KOKKOS_INLINE_FUNCTION void operator()(const LO rowNode, LO &nnz) const
CoordsType::value_type SC
rows_type::non_const_type rows
MatrixType::ordinal_type LO