// time (ms) , Node xxx, OpCode xxx, symblic name
// 5.352, Node 5, OpCode 4, DEPTHWISE_CONV_2D
-
LOG(INFO) << std::fixed << std::setw(10) << std::setprecision(3)
<< (e->end_timestamp_us - e->begin_timestamp_us) / 1000.0
<< ", Node " << std::setw(3) << std::setprecision(3) << op_index
<< ", OpCode " << std::setw(3) << std::setprecision(3)
<< registration.builtin_code << ", "
<< EnumNameBuiltinOperator(
- (BuiltinOperator)registration.builtin_code)
+ static_cast<BuiltinOperator>(registration.builtin_code))
<< "\n";
}
if (s->profiling) profiler->StartProfiling();
struct timeval start_time, stop_time;
- gettimeofday(&start_time, NULL);
+ gettimeofday(&start_time, nullptr);
for (int i = 0; i < s->loop_count; i++) {
if (interpreter->Invoke() != kTfLiteOk) {
LOG(FATAL) << "Failed to invoke tflite!\n";
}
}
- gettimeofday(&stop_time, NULL);
+ gettimeofday(&stop_time, nullptr);
LOG(INFO) << "invoked \n";
LOG(INFO) << "average time: "
<< (get_us(stop_time) - get_us(start_time)) / (s->loop_count * 1000)
int c;
while (1) {
static struct option long_options[] = {
- {"accelerated", required_argument, 0, 'a'},
- {"count", required_argument, 0, 'c'},
- {"verbose", required_argument, 0, 'v'},
- {"image", required_argument, 0, 'i'},
- {"labels", required_argument, 0, 'l'},
- {"tflite_model", required_argument, 0, 'm'},
- {"profiling", required_argument, 0, 'p'},
- {"threads", required_argument, 0, 't'},
- {"input_mean", required_argument, 0, 'b'},
- {"input_std", required_argument, 0, 's'},
- {0, 0, 0, 0}};
+ {"accelerated", required_argument, nullptr, 'a'},
+ {"count", required_argument, nullptr, 'c'},
+ {"verbose", required_argument, nullptr, 'v'},
+ {"image", required_argument, nullptr, 'i'},
+ {"labels", required_argument, nullptr, 'l'},
+ {"tflite_model", required_argument, nullptr, 'm'},
+ {"profiling", required_argument, nullptr, 'p'},
+ {"threads", required_argument, nullptr, 't'},
+ {"input_mean", required_argument, nullptr, 'b'},
+ {"input_std", required_argument, nullptr, 's'},
+ {nullptr, 0, nullptr, 0}};
/* getopt_long stores the option index here. */
int option_index = 0;
switch (c) {
case 'a':
- s.accel = strtol( // NOLINT(runtime/deprecated_fn)
- optarg, (char**)NULL, 10);
+ s.accel = strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn)
break;
case 'b':
- s.input_mean = strtod(optarg, NULL);
+ s.input_mean = strtod(optarg, nullptr);
break;
case 'c':
- s.loop_count = strtol( // NOLINT(runtime/deprecated_fn)
- optarg, (char**)NULL, 10);
+ s.loop_count =
+ strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn)
break;
case 'i':
s.input_bmp_name = optarg;
s.model_name = optarg;
break;
case 'p':
- s.profiling = strtol( // NOLINT(runtime/deprecated_fn)
- optarg, (char**)NULL, 10);
+ s.profiling =
+ strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn)
break;
case 's':
- s.input_std = strtod(optarg, NULL);
+ s.input_std = strtod(optarg, nullptr);
break;
case 't':
s.number_of_threads = strtol( // NOLINT(runtime/deprecated_fn)
- optarg, (char**)NULL, 10);
+ optarg, nullptr, 10);
break;
case 'v':
- s.verbose = strtol( // NOLINT(runtime/deprecated_fn)
- optarg, (char**)NULL, 10);
+ s.verbose =
+ strtol(optarg, nullptr, 10); // NOLINT(runtime/deprecated_fn)
break;
case 'h':
case '?':