diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index 1f1b89c2427e67..aa443aaaa259e3 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -61,9 +61,12 @@ bool parse_and_check_command_line(int argc, char* argv[]) { if (FLAGS_api != "async" && FLAGS_api != "sync") { throw std::logic_error("Incorrect API. Please set -api option to `sync` or `async` value."); } - if (FLAGS_api == "sync" && FLAGS_nireq > FLAGS_niter) { - throw std::logic_error( - "Number of iterations should be greater than number of infer requests when using sync API."); + if (FLAGS_api == "sync") { + if (FLAGS_t == 0) + &&(FLAGS_nireq > FLAGS_niter) { + throw std::logic_error( + "Number of iterations should be greater than number of infer requests when using sync API."); + } } if (!FLAGS_hint.empty() && FLAGS_hint != "throughput" && FLAGS_hint != "tput" && FLAGS_hint != "latency" && FLAGS_hint != "cumulative_throughput" && FLAGS_hint != "ctput" && FLAGS_hint != "none") { diff --git a/tools/benchmark_tool/openvino/tools/benchmark/main.py b/tools/benchmark_tool/openvino/tools/benchmark/main.py index acec4d17bdc377..c42c144e626d46 100755 --- a/tools/benchmark_tool/openvino/tools/benchmark/main.py +++ b/tools/benchmark_tool/openvino/tools/benchmark/main.py @@ -49,8 +49,9 @@ def arg_not_empty(arg_value,empty_value): raise Exception("Cannot set precision for a compiled model. " \ "Please re-compile your model with required precision.") - if args.api_type == "sync" and args.number_infer_requests > args.number_iterations: - raise Exception("Number of infer requests should be less than or equal to number of iterations in sync mode.") + if args.api_type == "sync": + if args.time == 0 and (args.number_infer_requests > args.number_iterations): + raise Exception("Number of infer requests should be less than or equal to number of iterations in sync mode.") return args, is_network_compiled