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