Skip to content

Commit df6161d

Browse files
authored
Add -pc flag to compile_tool (openvinotoolkit#29217)
### Details: Add -pc flag in `compile_tool`. ### Tickets: E#158335
1 parent 5cc808c commit df6161d

File tree

1 file changed

+8
-2
lines changed
  • src/plugins/intel_npu/tools/compile_tool

1 file changed

+8
-2
lines changed

src/plugins/intel_npu/tools/compile_tool/main.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ static constexpr char log_level_message[] = "Optional. Log level for OpenVINO li
3939

4040
static constexpr char config_message[] = "Optional. Path to the configuration file.";
4141

42+
static constexpr char perf_count_message[] = "Optional. Set PERF_COUNT config property.";
43+
4244
static constexpr char inputs_precision_message[] = "Optional. Specifies precision for all input layers of the network.";
4345

4446
static constexpr char outputs_precision_message[] =
@@ -79,14 +81,15 @@ static const char shape_message[] =
7981
" For dynamic dimensions use symbol `?` or '-1'. Ex. [?,3,?,?]."
8082
" For bounded dimensions specify range 'min..max'. Ex. [1..10,3,?,?].";
8183

82-
static const char override_model_batch_size[] = "Enforce a model to be compiled for batch size";
84+
static constexpr char override_model_batch_size_message[] = "Enforce a model to be compiled for batch size";
8385

8486
DEFINE_bool(h, false, help_message);
8587
DEFINE_string(m, "", model_message);
8688
DEFINE_string(d, "", targetDeviceMessage);
8789
DEFINE_string(o, "", output_message);
8890
DEFINE_string(log_level, "", log_level_message);
8991
DEFINE_string(c, "", config_message);
92+
DEFINE_bool(pc, false, perf_count_message);
9093
DEFINE_string(ip, "", inputs_precision_message);
9194
DEFINE_string(op, "", outputs_precision_message);
9295
DEFINE_string(iop, "", iop_message);
@@ -97,7 +100,7 @@ DEFINE_string(iml, "", inputs_model_layout_message);
97100
DEFINE_string(oml, "", outputs_model_layout_message);
98101
DEFINE_string(ioml, "", ioml_message);
99102
DEFINE_string(shape, "", shape_message);
100-
DEFINE_uint32(override_model_batch_size, 1, override_model_batch_size);
103+
DEFINE_uint32(override_model_batch_size, 1, override_model_batch_size_message);
101104

102105
namespace {
103106
std::vector<std::string> splitStringList(const std::string& str, char delim) {
@@ -449,6 +452,9 @@ int main(int argc, char* argv[]) {
449452
auto timeBeforeLoadNetwork = std::chrono::steady_clock::now();
450453
std::cout << "Parsing configuration file" << std::endl;
451454
auto configs = parseConfigFile();
455+
if (FLAGS_pc) {
456+
configs["PERF_COUNT"] = "YES";
457+
}
452458

453459
std::cout << "Compiling model" << std::endl;
454460
auto compiledModel = core.compile_model(model, FLAGS_d, {configs.begin(), configs.end()});

0 commit comments

Comments
 (0)