21 #include <opm/common/ErrorMacros.hpp> 37 enum class LinearSolverAcceleratorType { GPU = 0, CPU = 1 };
46 toString(LinearSolverAcceleratorType type)
49 case LinearSolverAcceleratorType::GPU:
51 case LinearSolverAcceleratorType::CPU:
54 OPM_THROW(std::runtime_error,
"Unknown LinearSolverAcceleratorType");
65 inline LinearSolverAcceleratorType
66 linearSolverAcceleratorTypeFromString(
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);
83 inline LinearSolverAcceleratorType
84 linearSolverAcceleratorTypeFromCLI()
86 return linearSolverAcceleratorTypeFromString(Parameters::Get<LinearSolverAccelerator>());
Definition: blackoilnewtonmethodparams.hpp:31
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