| 340 | } |
| 341 | |
| 342 | int Main(int argc, char** argv) { |
| 343 | Settings s; |
| 344 | |
| 345 | int c; |
| 346 | while (1) { |
| 347 | static struct option long_options[] = { |
| 348 | {"accelerated", required_argument, nullptr, 'a'}, |
| 349 | {"old_accelerated", required_argument, nullptr, 'd'}, |
| 350 | {"allow_fp16", required_argument, nullptr, 'f'}, |
| 351 | {"count", required_argument, nullptr, 'c'}, |
| 352 | {"verbose", required_argument, nullptr, 'v'}, |
| 353 | {"image", required_argument, nullptr, 'i'}, |
| 354 | {"labels", required_argument, nullptr, 'l'}, |
| 355 | {"tflite_model", required_argument, nullptr, 'm'}, |
| 356 | {"profiling", required_argument, nullptr, 'p'}, |
| 357 | {"threads", required_argument, nullptr, 't'}, |
| 358 | {"input_mean", required_argument, nullptr, 'b'}, |
| 359 | {"input_std", required_argument, nullptr, 's'}, |
| 360 | {"num_results", required_argument, nullptr, 'r'}, |
| 361 | {"max_profiling_buffer_entries", required_argument, nullptr, 'e'}, |
| 362 | {"warmup_runs", required_argument, nullptr, 'w'}, |
| 363 | {"gl_backend", required_argument, nullptr, 'g'}, |
| 364 | {nullptr, 0, nullptr, 0}}; |
| 365 | |
| 366 | /* getopt_long stores the option index here. */ |
| 367 | int option_index = 0; |
| 368 | |
| 369 | c = getopt_long(argc, argv, |
| 370 | "a:b:c:d:e:f:g:i:l:m:p:r:s:t:v:w:", long_options, |
| 371 | &option_index); |
| 372 | |
| 373 | /* Detect the end of the options. */ |
| 374 | if (c == -1) break; |
| 375 | |
| 376 | switch (c) { |
| 377 | case 'a': |
| 378 | s.accel = strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn) |
| 379 | break; |
| 380 | case 'b': |
| 381 | s.input_mean = strtod(optarg, nullptr); |
| 382 | break; |
| 383 | case 'c': |
| 384 | s.loop_count = |
| 385 | strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn) |
| 386 | break; |
| 387 | case 'd': |
| 388 | s.old_accel = |
| 389 | strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn) |
| 390 | break; |
| 391 | case 'e': |
| 392 | s.max_profiling_buffer_entries = |
| 393 | strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn) |
| 394 | break; |
| 395 | case 'f': |
| 396 | s.allow_fp16 = |
| 397 | strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn) |
| 398 | break; |
| 399 | case 'g': |
no test coverage detected