From c2963560d2aa26dd0adc004ab2a6cecada9c3c41 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 11 Oct 2022 10:42:08 +0200 Subject: [PATCH] Fix compilationw with amgcl/vexcl and without CUDA/OpenCL. There is no reason to omit WellContributions if neither CUDA nor OpenCL is found as the implementations/functions only use C++- To the contrary, the defines used for deactivating were not consistent with usage elsewhere and resulted in compiler erorrs for exotic configuration --- opm/simulators/wells/BlackoilWellModel.hpp | 2 -- opm/simulators/wells/BlackoilWellModel_impl.hpp | 4 ++-- opm/simulators/wells/MultisegmentWellEval.cpp | 2 -- opm/simulators/wells/MultisegmentWellEval.hpp | 2 -- opm/simulators/wells/StandardWellEval.cpp | 6 +----- opm/simulators/wells/StandardWellEval.hpp | 2 -- opm/simulators/wells/StandardWellGeneric.cpp | 2 -- opm/simulators/wells/StandardWellGeneric.hpp | 2 -- 8 files changed, 3 insertions(+), 19 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index d418a5db8..c23ff4b67 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -253,10 +253,8 @@ namespace Opm { // subtract B*inv(D)*C * x from A*x void apply(const BVector& x, BVector& Ax) const; -#if HAVE_CUDA || HAVE_OPENCL // accumulate the contributions of all Wells in the WellContributions object void getWellContributions(WellContributions& x) const; -#endif // apply well model with scaling of alpha void applyScaleAdd(const Scalar alpha, const BVector& x, BVector& Ax) const; diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 27e7c682f..048c2f7da 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -27,6 +27,8 @@ #include #include +#include + #if HAVE_MPI #include #endif @@ -1191,7 +1193,6 @@ namespace Opm { } } -#if HAVE_CUDA || HAVE_OPENCL template void BlackoilWellModel:: @@ -1229,7 +1230,6 @@ namespace Opm { } } } -#endif // Ax = Ax - alpha * C D^-1 B x template diff --git a/opm/simulators/wells/MultisegmentWellEval.cpp b/opm/simulators/wells/MultisegmentWellEval.cpp index ea18c0311..17174afca 100644 --- a/opm/simulators/wells/MultisegmentWellEval.cpp +++ b/opm/simulators/wells/MultisegmentWellEval.cpp @@ -1815,7 +1815,6 @@ updateUpwindingSegments() } } -#if HAVE_CUDA || HAVE_OPENCL template void MultisegmentWellEval:: @@ -1883,7 +1882,6 @@ addWellContribution(WellContributions& wellContribs) const Drows, Cvals); } -#endif #define INSTANCE(A,...) \ template class MultisegmentWellEval,__VA_ARGS__,double>; diff --git a/opm/simulators/wells/MultisegmentWellEval.hpp b/opm/simulators/wells/MultisegmentWellEval.hpp index 6e6be6b49..d9c59f56e 100644 --- a/opm/simulators/wells/MultisegmentWellEval.hpp +++ b/opm/simulators/wells/MultisegmentWellEval.hpp @@ -54,10 +54,8 @@ template class MultisegmentWellEval : public MultisegmentWellGeneric { public: -#if HAVE_CUDA || HAVE_OPENCL /// add the contribution (C, D, B matrices) of this Well to the WellContributions object void addWellContribution(WellContributions& wellContribs) const; -#endif protected: // TODO: for now, not considering the polymer, solvent and so on to simplify the development process. diff --git a/opm/simulators/wells/StandardWellEval.cpp b/opm/simulators/wells/StandardWellEval.cpp index 25961913d..0adb2991c 100644 --- a/opm/simulators/wells/StandardWellEval.cpp +++ b/opm/simulators/wells/StandardWellEval.cpp @@ -34,13 +34,11 @@ #include #include #include +#include #include #include -#if HAVE_CUDA || HAVE_OPENCL -#include -#endif namespace Opm @@ -1109,7 +1107,6 @@ init(std::vector& perf_depth, } } -#if HAVE_CUDA || HAVE_OPENCL template void StandardWellEval:: @@ -1158,7 +1155,6 @@ addWellContribution(WellContributions& wellContribs) const } wellContribs.addMatrix(WellContributions::MatrixType::B, colIndices.data(), nnzValues.data(), this->duneB_.nonzeroes()); } -#endif #define INSTANCE(A,...) \ template class StandardWellEval,__VA_ARGS__,double>; diff --git a/opm/simulators/wells/StandardWellEval.hpp b/opm/simulators/wells/StandardWellEval.hpp index a460c9b01..7ed1b52d3 100644 --- a/opm/simulators/wells/StandardWellEval.hpp +++ b/opm/simulators/wells/StandardWellEval.hpp @@ -96,10 +96,8 @@ public: using Eval = DenseAd::Evaluation; using BVectorWell = typename StandardWellGeneric::BVectorWell; -#if HAVE_CUDA || HAVE_OPENCL /// add the contribution (C, D^-1, B matrices) of this Well to the WellContributions object void addWellContribution(WellContributions& wellContribs) const; -#endif protected: StandardWellEval(const WellInterfaceIndices& baseif); diff --git a/opm/simulators/wells/StandardWellGeneric.cpp b/opm/simulators/wells/StandardWellGeneric.cpp index a6de18d32..0121924ca 100644 --- a/opm/simulators/wells/StandardWellGeneric.cpp +++ b/opm/simulators/wells/StandardWellGeneric.cpp @@ -518,7 +518,6 @@ checkConvergencePolyMW(const std::vector& res, } -#if HAVE_CUDA || HAVE_OPENCL template void StandardWellGeneric:: @@ -526,7 +525,6 @@ getNumBlocks(unsigned int& numBlocks) const { numBlocks = duneB_.nonzeroes(); } -#endif template class StandardWellGeneric; diff --git a/opm/simulators/wells/StandardWellGeneric.hpp b/opm/simulators/wells/StandardWellGeneric.hpp index d943d4234..6eb8be8f1 100644 --- a/opm/simulators/wells/StandardWellGeneric.hpp +++ b/opm/simulators/wells/StandardWellGeneric.hpp @@ -65,10 +65,8 @@ protected: using OffDiagMatWell = Dune::BCRSMatrix; public: -#if HAVE_CUDA || HAVE_OPENCL /// get the number of blocks of the C and B matrices, used to allocate memory in a WellContributions object void getNumBlocks(unsigned int& _nnzs) const; -#endif protected: StandardWellGeneric(int Bhp,