21#include <opm/common/ErrorMacros.hpp>
26namespace Opm::Parameters
37enum class LinearSolverAcceleratorType { GPU = 0, CPU = 1 };
46toString(LinearSolverAcceleratorType type)
49 case LinearSolverAcceleratorType::GPU:
51 case LinearSolverAcceleratorType::CPU:
54 OPM_THROW(std::runtime_error,
"Unknown LinearSolverAcceleratorType");
65inline LinearSolverAcceleratorType
66linearSolverAcceleratorTypeFromString(
const std::string& str)
68 std::string lowerStr = str;
69 std::ranges::transform(lowerStr, lowerStr.begin(),
70 [](
unsigned char c) { return std::tolower(c); });
71 if (lowerStr ==
"gpu") {
72 return LinearSolverAcceleratorType::GPU;
73 }
else if (lowerStr ==
"cpu") {
74 return LinearSolverAcceleratorType::CPU;
76 OPM_THROW(std::runtime_error,
"Unknown LinearSolverAcceleratorType: " + str);
83inline LinearSolverAcceleratorType
84linearSolverAcceleratorTypeFromCLI()
86 return linearSolverAcceleratorTypeFromString(Parameters::Get<LinearSolverAccelerator>());
Declares the parameters for the black oil model.
Declares the properties required by the black oil model.
For the CLI options.
Definition LinearSolverAcceleratorType.hpp:32