| 50 | } |
| 51 | |
| 52 | bool bool_arg(int argc, char ** argv, const std::string & name, bool fallback) { |
| 53 | const std::string value = arg_value(argc, argv, name, fallback ? "true" : "false"); |
| 54 | if (value == "1" || value == "true" || value == "yes") { |
| 55 | return true; |
| 56 | } |
| 57 | if (value == "0" || value == "false" || value == "no") { |
| 58 | return false; |
| 59 | } |
| 60 | throw std::runtime_error("invalid boolean value for " + name + ": " + value); |
| 61 | } |
| 62 | |
| 63 | engine::core::BackendType parse_backend(const std::string & value) { |
| 64 | if (value == "cpu") { |