Skip to content

Commit

Permalink
Revert "[BENCHMARK_APP] Show input command in output (openvinotoolkit…
Browse files Browse the repository at this point in the history
…#13402)" (openvinotoolkit#14027)

This reverts commit f893a58.
  • Loading branch information
nkogteva authored and Lyamin-Roman committed Nov 22, 2022
1 parent d04864e commit 1ea648c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 47 deletions.
38 changes: 0 additions & 38 deletions samples/cpp/benchmark_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,10 @@
#include "remote_tensors_filling.hpp"
#include "statistics_report.hpp"
#include "utils.hpp"

#if defined(_WIN32) || defined(WIN32)
# include <windows.h>
#endif
// clang-format on

static const size_t progressBarDefaultTotalCount = 1000;

std::string get_console_command(int argc, char* argv[]) {
std::stringstream args_command;

#if defined(_WIN32) || defined(WIN32)
std::string relative_path(argv[0]);
std::vector<char> buffer;

uint32_t len = 1;
do {
buffer.resize(len);
len = GetFullPathNameA(relative_path.data(), len, buffer.data(), nullptr);
} while (len > buffer.size());

std::string full_path(buffer.begin(), buffer.end());
args_command << full_path;
#else
args_command << realpath(argv[0], nullptr);
#endif
args_command << " ";

for (int i = 1; i < argc; i++) {
args_command << argv[i] << " ";
}

return args_command.str();
}

bool parse_and_check_command_line(int argc, char* argv[]) {
// ---------------------------Parsing and validating input
// arguments--------------------------------------
Expand Down Expand Up @@ -224,19 +193,12 @@ int main(int argc, char* argv[]) {

// ----------------- 1. Parsing and validating input arguments
// -------------------------------------------------

// Must be executed before parse_and_check_command_line()
// gflags::ParseCommandLineNonHelpFlags() modifies the argv array
auto command_from_args = get_console_command(argc, argv);

next_step();

if (!parse_and_check_command_line(argc, argv)) {
return 0;
}

slog::info << "Input command: " << command_from_args << slog::endl;

bool isNetworkCompiled = fileExt(FLAGS_m) == "blob";
if (isNetworkCompiled) {
slog::info << "Model is compiled" << slog::endl;
Expand Down
13 changes: 4 additions & 9 deletions tools/benchmark_tool/openvino/tools/benchmark/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def arg_not_empty(arg_value,empty_value):
raise Exception("-nstreams, -nthreads and -pin options are fine tune options. To use them you " \
"should explicitely set -hint option to none. This is not OpenVINO limitation " \
"(those options can be used in OpenVINO together), but a benchmark_app UI rule.")

if args.report_type == "average_counters" and "MULTI" in args.target_device:
raise Exception("only detailed_counters report type is supported for MULTI device")

_, ext = os.path.splitext(args.path_to_model)
is_network_compiled = True if ext == BLOB_EXTENSION else False
is_precisiton_set = not (args.input_precision == "" and args.output_precision == "" and args.input_output_precision == "")
Expand All @@ -48,21 +48,16 @@ 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 " \
"using compile_tool")

return args, is_network_compiled

def main():
statistics = None
try:
# ------------------------------ 1. Parsing and validating input arguments ------------------------------
args_string = f"{os.path.realpath(sys.argv[0])} "
for i in range(1,len(sys.argv)):
args_string += f"{sys.argv[i]} "

next_step()
logger.info("Parsing input parameters")
args, is_network_compiled = parse_and_check_command_line()
logger.info(f"Input command: {args_string}")

command_line_arguments = get_command_line_arguments(sys.argv)
if args.report_type:
Expand Down Expand Up @@ -509,7 +504,7 @@ def set_throughput_streams():
total_sorted_list = print_perf_counters_sort(perfs_count_list,sort_flag=args.perf_counts_sort)
if statistics:
statistics.dump_performance_counters_sorted(total_sorted_list)

elif args.perf_counts:
print_perf_counters(perfs_count_list)

Expand Down

0 comments on commit 1ea648c

Please sign in to comment.