diff --git a/packages/muelu/research/caglusa/Xpetra_HierarchicalOperator_decl.hpp b/packages/muelu/research/caglusa/Xpetra_HierarchicalOperator_decl.hpp index f65d3a7a8bca..98910ac96fe5 100644 --- a/packages/muelu/research/caglusa/Xpetra_HierarchicalOperator_decl.hpp +++ b/packages/muelu/research/caglusa/Xpetra_HierarchicalOperator_decl.hpp @@ -37,12 +37,12 @@ class HierarchicalOperator : public TpetraOperator& params = Teuchos::null); //! Returns the Tpetra::Map object associated with the domain of this operator. - Teuchos::RCP getDomainMap() const { + const Teuchos::RCP getDomainMap() const { return toXpetra(op_->getDomainMap()); } //! Returns the Tpetra::Map object associated with the range of this operator. - Teuchos::RCP getRangeMap() const { + const Teuchos::RCP getRangeMap() const { return toXpetra(op_->getRangeMap()); } diff --git a/packages/muelu/research/graham/mf_example_01.cpp b/packages/muelu/research/graham/mf_example_01.cpp index d06286f63d92..51f2dd6b4540 100644 --- a/packages/muelu/research/graham/mf_example_01.cpp +++ b/packages/muelu/research/graham/mf_example_01.cpp @@ -268,10 +268,10 @@ class TridiagonalOperator : public Xpetra::Operator getDomainMap() const { return opMap_; } + const Teuchos::RCP getDomainMap() const { return opMap_; } //! Returns the Xpetra::Map object associated with the range of this operator. - Teuchos::RCP getRangeMap() const { return opMap_; } + const Teuchos::RCP getRangeMap() const { return opMap_; } //! Indicates whether this operator supports applying the adjoint operator. bool hasTransposeApply() const { return true; } @@ -405,10 +405,10 @@ class MFProlongatorOperator : public Xpetra::Operator getDomainMap() const { return domainMap_; } + const Teuchos::RCP getDomainMap() const { return domainMap_; } //! Returns the Xpetra::Map object associated with the range of this operator. - Teuchos::RCP getRangeMap() const { return rangeMap_; } + const Teuchos::RCP getRangeMap() const { return rangeMap_; } //! Indicates whether this operator supports applying the adjoint operator. bool hasTransposeApply() const { return true; } diff --git a/packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp b/packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp index e27fedd26abb..f11695d05936 100644 --- a/packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp +++ b/packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp @@ -200,8 +200,8 @@ UtilitiesBase:: const CrsMatrixWrap* crsOp = dynamic_cast(&A); if ((crsOp != NULL) && (rowMap->lib() == Xpetra::UseTpetra)) { using local_vector_type = typename Vector::dual_view_type::t_dev_um; - using execution_space = typename local_vector_type::execution_space; - Kokkos::View offsets("offsets", rowMap->getLocalNumElements()); + using device_type = typename CrsGraph::device_type; + Kokkos::View offsets("offsets", rowMap->getLocalNumElements()); crsOp->getCrsGraph()->getLocalDiagOffsets(offsets); crsOp->getCrsMatrix()->getLocalDiagCopy(*diag, offsets); } else { @@ -1012,6 +1012,9 @@ DetectDirichletRows_kokkos(const Xpetra::Matrix& A, Kokkos::deep_copy(boundaryNodes2, boundaryNodes); return boundaryNodes2; } + // CAG: No idea why this is needed to avoid "warning: missing return statement at end of non-void function" + Kokkos::View dummy("dummy", 0); + return dummy; } template diff --git a/packages/muelu/test/interface/CreateOperator.cpp b/packages/muelu/test/interface/CreateOperator.cpp index ea46ecf25665..3896cfcd79ae 100644 --- a/packages/muelu/test/interface/CreateOperator.cpp +++ b/packages/muelu/test/interface/CreateOperator.cpp @@ -185,11 +185,11 @@ void run_sed(const std::string& pattern, const std::string& baseFile) { #ifdef __APPLE__ sed_pref = sed_pref + "\"\" "; #endif - int ret_val = 0; - (void)ret_val; // suppress fscanf return value and unused variable warnings - ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str()); + ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str()); + TEUCHOS_ASSERT_EQUALITY(ret_val, 0); ret_val = system((sed_pref + pattern + " " + baseFile + ".out_filtered").c_str()); + TEUCHOS_ASSERT_EQUALITY(ret_val, 0); } bool compare_to_gold(int myRank, const std::string& baseFile) { @@ -198,9 +198,10 @@ bool compare_to_gold(int myRank, const std::string& baseFile) { // Create a copy of outputs std::string cmd = "cp -f "; int ret_val = 0; - (void)ret_val; // suppress fscanf return value and unused variable warnings - ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str()); + ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str()); + TEUCHOS_ASSERT_EQUALITY(ret_val, 0); ret_val = system((cmd + baseFile + ".out " + baseFile + ".out_filtered").c_str()); + TEUCHOS_ASSERT_EQUALITY(ret_val, 0); // Tpetra produces different eigenvalues in Chebyshev due to using // std::rand() for generating random vectors, which may be initialized diff --git a/packages/muelu/test/scaling/MatrixLoad.hpp b/packages/muelu/test/scaling/MatrixLoad.hpp index cce8daf684ef..d5634763cd27 100644 --- a/packages/muelu/test/scaling/MatrixLoad.hpp +++ b/packages/muelu/test/scaling/MatrixLoad.hpp @@ -290,7 +290,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe if (mueluList.sublist(smootherOrCoarse + ": params").sublist("subdomain solver parameters").get("partitioner: type") == "user") { FILE* fp; int retVal; - int nBlks, nRows, nnzs, ch, row, col; + int nBlks, nRows, nnzs, row, col; int procId = comm->getRank(); double val; @@ -301,7 +301,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe fp = fopen(&userBlkFileName[0], "r"); TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found"); - while ((ch = getc(fp) != '\n')) + while ((getc(fp) != '\n')) ; // read first line retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs); @@ -367,7 +367,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe fp = fopen(&userBlkFileName[0], "r"); TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found"); - while ((ch = getc(fp) != '\n')) + while ((getc(fp) != '\n')) ; retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs);