diff --git a/opm/simulators/linalg/bda/BdaBridge.cpp b/opm/simulators/linalg/bda/BdaBridge.cpp index 01bdab36f..5da044710 100644 --- a/opm/simulators/linalg/bda/BdaBridge.cpp +++ b/opm/simulators/linalg/bda/BdaBridge.cpp @@ -50,7 +50,9 @@ #include #endif -typedef Dune::InverseOperatorResult InverseOperatorResult; +#include + +using InverseOperatorResult = Dune::InverseOperatorResult; namespace Opm { @@ -95,10 +97,14 @@ BdaBridge(std::string accelerator_mode_, #endif } else if (accelerator_mode.compare("amgcl") == 0) { #if HAVE_AMGCL - use_gpu = true; // should be replaced by a 'use_bridge' boolean - using AMGCL = Accelerator::amgclSolverBackend; - backend = std::make_unique(linear_solver_verbosity, maxit, - tolerance, platformID, deviceID); + if constexpr (std::is_same_v) { + OPM_THROW(std::logic_error, "Error amgclSolver disabled with float Scalar"); + } else { + use_gpu = true; // should be replaced by a 'use_bridge' boolean + using AMGCL = Accelerator::amgclSolverBackend; + backend = std::make_unique(linear_solver_verbosity, maxit, + tolerance, platformID, deviceID); + } #else OPM_THROW(std::logic_error, "Error amgclSolver was chosen, but amgcl was not found by CMake"); #endif