| 29 | } |
| 30 | |
| 31 | std::vector<std::pair<std::string, std::string>> parse_session_options(int argc, char ** argv) { |
| 32 | std::vector<std::pair<std::string, std::string>> out; |
| 33 | for (int i = 1; i + 1 < argc; ++i) { |
| 34 | if (std::string(argv[i]) != "--session-option") { |
| 35 | continue; |
| 36 | } |
| 37 | const std::string option = argv[i + 1]; |
| 38 | const size_t eq = option.find('='); |
| 39 | if (eq == std::string::npos || eq == 0) { |
| 40 | throw std::runtime_error("invalid Vevo2 --session-option: " + option); |
| 41 | } |
| 42 | out.emplace_back(option.substr(0, eq), option.substr(eq + 1)); |
| 43 | } |
| 44 | return out; |
| 45 | } |
| 46 | |
| 47 | engine::core::BackendType parse_backend(const std::string & value) { |
| 48 | if (value == "cpu") { |