| 47 | } |
| 48 | |
| 49 | inline std::vector<std::pair<std::string, std::string>> session_option_args(int argc, char ** argv) { |
| 50 | std::vector<std::pair<std::string, std::string>> out; |
| 51 | for (int i = 1; i + 1 < argc; ++i) { |
| 52 | if (std::string(argv[i]) != "--session-option") { |
| 53 | continue; |
| 54 | } |
| 55 | const std::string option = argv[i + 1]; |
| 56 | const size_t sep = option.find('='); |
| 57 | if (sep == std::string::npos || sep == 0) { |
| 58 | throw std::runtime_error("invalid audio warmbench --session-option: " + option); |
| 59 | } |
| 60 | out.emplace_back(option.substr(0, sep), option.substr(sep + 1)); |
| 61 | } |
| 62 | return out; |
| 63 | } |
| 64 | |
| 65 | inline engine::core::BackendType parse_backend(const std::string & value) { |
| 66 | if (value == "cpu") { |
no test coverage detected