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::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), [](
unsigned char c) { return std::tolower(c); });
70 if (lowerStr ==
"gpu") {
71 return LinearSolverAcceleratorType::GPU;
72 }
else if (lowerStr ==
"cpu") {
73 return LinearSolverAcceleratorType::CPU;
75 OPM_THROW(std::runtime_error,
"Unknown LinearSolverAcceleratorType: " + str);
82inline LinearSolverAcceleratorType
83linearSolverAcceleratorTypeFromCLI()
85 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