From cdad4500c186a1111ee4ac000b65da6ecdca0d68 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 16 Apr 2024 14:29:46 +0200 Subject: [PATCH] amgclSolverBackend: disable for float scalar for reasons deep down in amgcl, it does not compile. for now just disable it --- opm/simulators/linalg/bda/BdaBridge.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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