diff --git a/mace/benchmark/benchmark_model.cc b/mace/benchmark/benchmark_model.cc index 95b093c1b2ec087085b30fcd1d33633bba2b8abb..38db846b2a5c651e4dead8357ce1753649f6bd65 100644 --- a/mace/benchmark/benchmark_model.cc +++ b/mace/benchmark/benchmark_model.cc @@ -2,16 +2,18 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#include "gflags/gflags.h" -#include "mace/public/mace.h" -#include "mace/utils/logging.h" -#include "mace/benchmark/stat_summarizer.h" + +#include #include #include -#include #include -#include +#include // NOLINT(build/c++11) + +#include "gflags/gflags.h" +#include "mace/public/mace.h" +#include "mace/utils/logging.h" +#include "mace/benchmark/stat_summarizer.h" namespace mace { namespace MACE_MODEL_TAG { @@ -24,10 +26,11 @@ extern NetDef CreateNet(const unsigned char *model_data); extern const std::string ModelChecksum(); -} -} +} // namespace MACE_MODEL_TAG +} // namespace mace namespace mace { +namespace benchmark { namespace str_util { std::vector Split(const std::string &str, char delims) { @@ -64,8 +67,6 @@ bool SplitAndParseToInts(const std::string &str, } // namespace str_util -namespace benchmark { - void ParseShape(const std::string &str, std::vector *shape) { std::string tmp = str; while (!tmp.empty()) { @@ -96,18 +97,19 @@ inline int64_t NowMicros() { bool RunInference(MaceEngine *engine, const std::vector &input_infos, - std::map &output_infos, + std::map *output_infos, StatSummarizer *summarizer, int64_t *inference_time_us) { + MACE_CHECK_NOTNULL(output_infos); RunMetadata run_metadata; RunMetadata *run_metadata_ptr = nullptr; if (summarizer) { run_metadata_ptr = &run_metadata; } - if (input_infos.size() == 1 && output_infos.size() == 1) { + if (input_infos.size() == 1 && output_infos->size() == 1) { const int64_t start_time = NowMicros(); bool s = engine->Run(input_infos[0].data, input_infos[0].shape, - output_infos.begin()->second, run_metadata_ptr); + output_infos->begin()->second, run_metadata_ptr); const int64_t end_time = NowMicros(); if (!s) { @@ -117,7 +119,7 @@ bool RunInference(MaceEngine *engine, *inference_time_us = end_time - start_time; } else { const int64_t start_time = NowMicros(); - bool s = engine->Run(input_infos, output_infos, run_metadata_ptr); + bool s = engine->Run(input_infos, *output_infos, run_metadata_ptr); const int64_t end_time = NowMicros(); if (!s) { @@ -136,13 +138,14 @@ bool RunInference(MaceEngine *engine, bool Run(MaceEngine *engine, const std::vector &input_infos, - std::map &output_infos, + std::map *output_infos, StatSummarizer *summarizer, int num_runs, double max_time_sec, int64_t sleep_sec, int64_t *total_time_us, int64_t *actual_num_runs) { + MACE_CHECK_NOTNULL(output_infos); *total_time_us = 0; LOG(INFO) << "Running benchmark for max " << num_runs << " iterators, max " @@ -156,7 +159,8 @@ bool Run(MaceEngine *engine, bool util_max_time = (num_runs <= 0); for (int i = 0; util_max_time || i < num_runs; ++i) { int64_t inference_time_us = 0; - bool s = RunInference(engine, input_infos, output_infos, summarizer, &inference_time_us); + bool s = RunInference(engine, input_infos, output_infos, + summarizer, &inference_time_us); stat.UpdateStat(inference_time_us); (*total_time_us) += inference_time_us; ++(*actual_num_runs); @@ -183,15 +187,18 @@ bool Run(MaceEngine *engine, } DEFINE_string(device, "CPU", "Device [CPU|OPENCL]"); -DEFINE_string(input_node, "input_node0,input_node1", "input nodes, separated by comma"); -DEFINE_string(output_node, "output_node0,output_node1", "output nodes, separated by comma"); +DEFINE_string(input_node, "input_node0,input_node1", + "input nodes, separated by comma"); +DEFINE_string(output_node, "output_node0,output_node1", + "output nodes, separated by comma"); DEFINE_string(input_shape, "", "input shape, separated by colon and comma"); DEFINE_string(output_shape, "", "output shape, separated by colon and comma"); DEFINE_string(input_file, "", "input file name"); DEFINE_int32(max_num_runs, 100, "number of runs max"); DEFINE_string(max_time, "10.0", "length to run max"); DEFINE_string(inference_delay, "-1", "delay between runs in seconds"); -DEFINE_string(inter_benchmark_delay, "-1", "delay between benchmarks in seconds"); +DEFINE_string(inter_benchmark_delay, "-1", + "delay between benchmarks in seconds"); DEFINE_string(benchmark_name, "", "benchmark name"); DEFINE_bool(show_run_order, true, "whether to list stats by run order"); DEFINE_int32(run_order_limit, 0, "how many items to show by run order"); @@ -203,15 +210,18 @@ DEFINE_bool(show_type, true, "whether to list stats by op type"); DEFINE_bool(show_summary, true, "whether to show a summary of the stats"); DEFINE_bool(show_flops, true, "whether to estimate the model's FLOPs"); DEFINE_int32(warmup_runs, 1, "how many runs to initialize model"); -DEFINE_string(model_data_file, "", "model data file name, used when EMBED_MODEL_DATA set to 0"); +DEFINE_string(model_data_file, "", + "model data file name, used when EMBED_MODEL_DATA set to 0"); DEFINE_string(gpu_type, "ADRENO", "ADRENO/MALI"); DEFINE_int32(gpu_perf_hint, 2, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); DEFINE_int32(gpu_priority_hint, 1, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); DEFINE_int32(omp_num_threads, 8, "num of openmp threads"); -DEFINE_int32(cpu_power_option, 0, "0:DEFAULT/1:HIGH_PERFORMANCE/2:BATTERY_SAVE"); +DEFINE_int32(cpu_power_option, 0, + "0:DEFAULT/1:HIGH_PERFORMANCE/2:BATTERY_SAVE"); int Main(int argc, char **argv) { - MACE_CHECK(FLAGS_device != "HEXAGON", "Model benchmark tool do not support DSP."); + MACE_CHECK(FLAGS_device != "HEXAGON", + "Model benchmark tool do not support DSP."); gflags::SetUsageMessage("some usage message"); gflags::ParseCommandLineFlags(&argc, &argv, true); @@ -228,12 +238,14 @@ int Main(int argc, char **argv) { LOG(INFO) << "output shapes: [" << FLAGS_output_shape << "]"; LOG(INFO) << "Warmup runs: [" << FLAGS_warmup_runs << "]"; LOG(INFO) << "Num runs: [" << FLAGS_max_num_runs << "]"; - LOG(INFO) << "Inter-inference delay (seconds): [" << FLAGS_inference_delay << "]"; - LOG(INFO) << "Inter-benchmark delay (seconds): [" << FLAGS_inter_benchmark_delay << "]"; + LOG(INFO) << "Inter-inference delay (seconds): [" + << FLAGS_inference_delay << "]"; + LOG(INFO) << "Inter-benchmark delay (seconds): [" + << FLAGS_inter_benchmark_delay << "]"; - const long int inter_inference_sleep_seconds = + const int64_t inter_inference_sleep_seconds = std::strtol(FLAGS_inference_delay.c_str(), nullptr, 10); - const long int inter_benchmark_sleep_seconds = + const int64_t inter_benchmark_sleep_seconds = std::strtol(FLAGS_inter_benchmark_delay.c_str(), nullptr, 10); const double max_benchmark_time_seconds = std::strtod(FLAGS_max_time.c_str(), nullptr); @@ -252,7 +264,7 @@ int Main(int argc, char **argv) { stats.reset(new StatSummarizer(stats_options)); DeviceType device_type = CPU; - if(FLAGS_device == "OPENCL") { + if (FLAGS_device == "OPENCL") { device_type = OPENCL; } @@ -264,17 +276,20 @@ int Main(int argc, char **argv) { gpu_type, static_cast(FLAGS_gpu_perf_hint), static_cast(FLAGS_gpu_priority_hint)); - } - else if (device_type == CPU) { + } else if (device_type == CPU) { mace::ConfigOmpThreadsAndAffinity( FLAGS_omp_num_threads, static_cast(FLAGS_cpu_power_option)); } - std::vector input_names = str_util::Split(FLAGS_input_node, ','); - std::vector output_names = str_util::Split(FLAGS_output_node, ','); - std::vector input_shapes = str_util::Split(FLAGS_input_shape, ':'); - std::vector output_shapes = str_util::Split(FLAGS_output_shape, ':'); + std::vector input_names = + str_util::Split(FLAGS_input_node, ','); + std::vector output_names = + str_util::Split(FLAGS_output_node, ','); + std::vector input_shapes = + str_util::Split(FLAGS_input_shape, ':'); + std::vector output_shapes = + str_util::Split(FLAGS_output_shape, ':'); const size_t input_count = input_shapes.size(); const size_t output_count = output_shapes.size(); @@ -298,10 +313,12 @@ int Main(int argc, char **argv) { for (size_t i = 0; i < input_count; ++i) { int64_t input_size = std::accumulate(input_shape_vec[i].begin(), - input_shape_vec[i].end(), 1, std::multiplies()); + input_shape_vec[i].end(), 1, + std::multiplies()); input_datas[i].reset(new float[input_size]); // load input - std::ifstream in_file(FLAGS_input_file + "_" + FormatName(input_names[i]), std::ios::in | std::ios::binary); + std::ifstream in_file(FLAGS_input_file + "_" + FormatName(input_names[i]), + std::ios::in | std::ios::binary); if (in_file.is_open()) { in_file.read(reinterpret_cast(input_datas[i].get()), input_size * sizeof(float)); @@ -317,7 +334,8 @@ int Main(int argc, char **argv) { } for (size_t i = 0; i < output_count; ++i) { int64_t output_size = std::accumulate(output_shape_vec[i].begin(), - output_shape_vec[i].end(), 1, std::multiplies()); + output_shape_vec[i].end(), 1, + std::multiplies()); output_datas[i].reset(new float[output_size]); output_infos[output_names[i]] = output_datas[i].get(); } @@ -328,7 +346,8 @@ int Main(int argc, char **argv) { if (input_count == 1 && output_count == 1) { engine_ptr.reset(new mace::MaceEngine(&net_def, device_type)); } else { - engine_ptr.reset(new mace::MaceEngine(&net_def, device_type, input_names, output_names)); + engine_ptr.reset(new mace::MaceEngine(&net_def, device_type, + input_names, output_names)); } if (device_type == DeviceType::OPENCL) { mace::MACE_MODEL_TAG::UnloadModelData(model_data); @@ -340,7 +359,8 @@ int Main(int argc, char **argv) { int64_t num_warmup_runs = 0; if (FLAGS_warmup_runs > 0) { bool status = - Run(engine_ptr.get(), input_infos, output_infos, nullptr, FLAGS_warmup_runs, -1.0, + Run(engine_ptr.get(), input_infos, &output_infos, nullptr, + FLAGS_warmup_runs, -1.0, inter_inference_sleep_seconds, &warmup_time_us, &num_warmup_runs); if (!status) { LOG(ERROR) << "Failed at warm up run"; @@ -354,7 +374,7 @@ int Main(int argc, char **argv) { int64_t no_stat_time_us = 0; int64_t no_stat_runs = 0; bool status = - Run(engine_ptr.get(), input_infos, output_infos, + Run(engine_ptr.get(), input_infos, &output_infos, nullptr, FLAGS_max_num_runs, max_benchmark_time_seconds, inter_inference_sleep_seconds, &no_stat_time_us, &no_stat_runs); if (!status) { @@ -363,7 +383,7 @@ int Main(int argc, char **argv) { int64_t stat_time_us = 0; int64_t stat_runs = 0; - status = Run(engine_ptr.get(), input_infos, output_infos, + status = Run(engine_ptr.get(), input_infos, &output_infos, stats.get(), FLAGS_max_num_runs, max_benchmark_time_seconds, inter_inference_sleep_seconds, &stat_time_us, &stat_runs); if (!status) { @@ -372,8 +392,8 @@ int Main(int argc, char **argv) { LOG(INFO) << "Average inference timings in us: " << "Warmup: " - << (FLAGS_warmup_runs > 0 ? warmup_time_us / FLAGS_warmup_runs : 0) << ", " - << "no stats: " << no_stat_time_us / no_stat_runs << ", " + << (FLAGS_warmup_runs > 0 ? warmup_time_us / FLAGS_warmup_runs : 0) + << ", " << "no stats: " << no_stat_time_us / no_stat_runs << ", " << "with stats: " << stat_time_us / stat_runs; stats->PrintOperatorStats(); @@ -381,7 +401,7 @@ int Main(int argc, char **argv) { return 0; } -} // namespace benchmark -} // namespace mace +} // namespace benchmark +} // namespace mace int main(int argc, char **argv) { mace::benchmark::Main(argc, argv); } diff --git a/mace/benchmark/model_throughput_test.cc b/mace/benchmark/model_throughput_test.cc index 48e622cb7b79b026b89ad6eb1fb4349056b2d9e8..bc2be7a6c61f4f7f796884cebed17d340dd2ebe1 100644 --- a/mace/benchmark/model_throughput_test.cc +++ b/mace/benchmark/model_throughput_test.cc @@ -19,16 +19,13 @@ #include #include #include -#include +#include // NOLINT(build/c++11) #include "gflags/gflags.h" #include "mace/public/mace.h" #include "mace/utils/env_time.h" #include "mace/utils/logging.h" -using namespace std; -using namespace mace; - namespace mace { #ifdef MACE_CPU_MODEL_TAG @@ -73,15 +70,15 @@ extern const std::string ModelChecksum(); } // namespace MACE_DSP_MODEL_TAG #endif -} // namespace mace +namespace benchmark { -void ParseShape(const string &str, vector *shape) { - string tmp = str; +void ParseShape(const std::string &str, std::vector *shape) { + std::string tmp = str; while (!tmp.empty()) { int dim = atoi(tmp.data()); shape->push_back(dim); size_t next_offset = tmp.find(","); - if (next_offset == string::npos) { + if (next_offset == std::string::npos) { break; } else { tmp = tmp.substr(next_offset + 1); @@ -89,7 +86,7 @@ void ParseShape(const string &str, vector *shape) { } } -DeviceType ParseDeviceType(const string &device_str) { +DeviceType ParseDeviceType(const std::string &device_str) { if (device_str.compare("CPU") == 0) { return DeviceType::CPU; } else if (device_str.compare("NEON") == 0) { @@ -111,20 +108,23 @@ DEFINE_string(gpu_model_data_file, "", "gpu model data file name"); DEFINE_string(dsp_model_data_file, "", "dsp model data file name"); DEFINE_int32(run_seconds, 10, "run seconds"); -int main(int argc, char **argv) { +int Main(int argc, char **argv) { gflags::SetUsageMessage("some usage message"); gflags::ParseCommandLineFlags(&argc, &argv, true); LOG(INFO) << "mace version: " << MaceVersion(); LOG(INFO) << "mace git version: " << MaceGitVersion(); #ifdef MACE_CPU_MODEL_TAG - LOG(INFO) << "cpu model checksum: " << mace::MACE_CPU_MODEL_TAG::ModelChecksum(); + LOG(INFO) << "cpu model checksum: " + << mace::MACE_CPU_MODEL_TAG::ModelChecksum(); #endif #ifdef MACE_GPU_MODEL_TAG - LOG(INFO) << "gpu model checksum: " << mace::MACE_GPU_MODEL_TAG::ModelChecksum(); + LOG(INFO) << "gpu model checksum: " + << mace::MACE_GPU_MODEL_TAG::ModelChecksum(); #endif #ifdef MACE_DSP_MODEL_TAG - LOG(INFO) << "dsp model checksum: " << mace::MACE_DSP_MODEL_TAG::ModelChecksum(); + LOG(INFO) << "dsp model checksum: " + << mace::MACE_DSP_MODEL_TAG::ModelChecksum(); #endif LOG(INFO) << "input_shape: " << FLAGS_input_shape; LOG(INFO) << "output_shape: " << FLAGS_output_shape; @@ -134,8 +134,8 @@ int main(int argc, char **argv) { LOG(INFO) << "dsp_model_data_file: " << FLAGS_dsp_model_data_file; LOG(INFO) << "run_seconds: " << FLAGS_run_seconds; - vector input_shape_vec; - vector output_shape_vec; + std::vector input_shape_vec; + std::vector output_shape_vec; ParseShape(FLAGS_input_shape, &input_shape_vec); ParseShape(FLAGS_output_shape, &output_shape_vec); @@ -151,7 +151,7 @@ int main(int argc, char **argv) { std::unique_ptr dsp_output_data(new float[output_size]); // load input - ifstream in_file(FLAGS_input_file, ios::in | ios::binary); + std::ifstream in_file(FLAGS_input_file, std::ios::in | std::ios::binary); if (in_file.is_open()) { in_file.read(reinterpret_cast(input_data.get()), input_size * sizeof(float)); @@ -166,7 +166,8 @@ int main(int argc, char **argv) { /* --------------------- CPU init ----------------------- */ LOG(INFO) << "Load & init cpu model and warm up"; const unsigned char *cpu_model_data = - mace::MACE_CPU_MODEL_TAG::LoadModelData(FLAGS_cpu_model_data_file.c_str()); + mace::MACE_CPU_MODEL_TAG::LoadModelData( + FLAGS_cpu_model_data_file.c_str()); NetDef cpu_net_def = mace::MACE_CPU_MODEL_TAG::CreateNet(cpu_model_data); mace::MaceEngine cpu_engine(&cpu_net_def, DeviceType::CPU); @@ -182,7 +183,8 @@ int main(int argc, char **argv) { /* --------------------- GPU init ----------------------- */ LOG(INFO) << "Load & init gpu model and warm up"; const unsigned char *gpu_model_data = - mace::MACE_GPU_MODEL_TAG::LoadModelData(FLAGS_gpu_model_data_file.c_str()); + mace::MACE_GPU_MODEL_TAG::LoadModelData( + FLAGS_gpu_model_data_file.c_str()); NetDef gpu_net_def = mace::MACE_GPU_MODEL_TAG::CreateNet(gpu_model_data); mace::MaceEngine gpu_engine(&gpu_net_def, DeviceType::OPENCL); @@ -199,7 +201,8 @@ int main(int argc, char **argv) { /* --------------------- DSP init ----------------------- */ LOG(INFO) << "Load & init dsp model and warm up"; const unsigned char *dsp_model_data = - mace::MACE_DSP_MODEL_TAG::LoadModelData(FLAGS_gpu_model_data_file.c_str()); + mace::MACE_DSP_MODEL_TAG::LoadModelData( + FLAGS_gpu_model_data_file.c_str()); NetDef dsp_net_def = mace::MACE_DSP_MODEL_TAG::CreateNet(dsp_model_data); mace::MaceEngine dsp_engine(&dsp_net_def, DeviceType::HEXAGON); @@ -278,4 +281,11 @@ int main(int argc, char **argv) { #endif LOG(INFO) << "Total throughput: " << total_throughput << " f/s"; + + return 0; } + +} // namespace benchmark +} // namespace mace + +int main(int argc, char **argv) { mace::benchmark::Main(argc, argv); } diff --git a/mace/benchmark/stat_summarizer.cc b/mace/benchmark/stat_summarizer.cc index ca8c5ec3db112ff4f6b3ea571b7b3a01c327bb2e..10a89d807d356cc5714e16520f0a3b3d200d9273 100644 --- a/mace/benchmark/stat_summarizer.cc +++ b/mace/benchmark/stat_summarizer.cc @@ -3,14 +3,18 @@ // #include "mace/benchmark/stat_summarizer.h" -#include "mace/public/mace.h" -#include "mace/utils/logging.h" #include -#include #include +#include +#include + +#include "mace/public/mace.h" +#include "mace/utils/logging.h" + namespace mace { +namespace benchmark { StatSummarizer::StatSummarizer(const StatSummarizerOptions &options) : options_(options) {} @@ -90,7 +94,7 @@ std::string StatSummarizer::HeaderString(const std::string &title) const { stream << "============================== " << title << " ==============================" << std::endl; - InitField(stream, 14) << "[node type]"; + InitField(stream, 24) << "[node type]"; InitField(stream, 9) << "[start]"; InitField(stream, 9) << "[first]"; InitField(stream, 9) << "[avg ms]"; @@ -114,7 +118,7 @@ std::string StatSummarizer::ColumnString(const StatSummarizer::Detail &detail, const int64_t times_called = detail.times_called / num_runs(); std::stringstream stream; - InitField(stream, 14) << detail.type; + InitField(stream, 24) << detail.type; InitField(stream, 9) << start_ms; InitField(stream, 9) << first_time_ms; InitField(stream, 9) << avg_time_ms; @@ -224,7 +228,7 @@ std::string StatSummarizer::GetStatsByNodeType() const { std::pair(node_type.first, mem_used)); } - InitField(stream, 14) << "[Node type]"; + InitField(stream, 24) << "[Node type]"; InitField(stream, 9) << "[count]"; InitField(stream, 10) << "[avg ms]"; InitField(stream, 11) << "[avg %]"; @@ -248,7 +252,7 @@ std::string StatSummarizer::GetStatsByNodeType() const { ((entry.first / static_cast(accumulated_us)) * 100.0f); cdf += percentage; - InitField(stream, 14) << node_type; + InitField(stream, 24) << node_type; InitField(stream, 9) << node_type_map_count[node_type]; InitField(stream, 10) << time_per_run_ms; InitField(stream, 10) << percentage << "%"; @@ -317,4 +321,5 @@ void StatSummarizer::PrintOperatorStats() const { } } +} // namespace benchmark } // namespace mace diff --git a/mace/benchmark/stat_summarizer.h b/mace/benchmark/stat_summarizer.h index 368b1e30299b77467b847396eeb20df586895618..8d2b99ad0d944fd8ff49d65db47bcc0fda494d87 100644 --- a/mace/benchmark/stat_summarizer.h +++ b/mace/benchmark/stat_summarizer.h @@ -2,10 +2,11 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#ifndef MACE_TOOLS_BENCHMARK_STAT_SUMMARIZER_H_ -#define MACE_TOOLS_BENCHMARK_STAT_SUMMARIZER_H_ +#ifndef MACE_BENCHMARK_STAT_SUMMARIZER_H_ +#define MACE_BENCHMARK_STAT_SUMMARIZER_H_ #include +#include #include #include #include @@ -17,6 +18,8 @@ namespace mace { class RunMetadata; +namespace benchmark { + template class Stat { public: @@ -194,6 +197,7 @@ class StatSummarizer { StatSummarizerOptions options_; }; -} // namespace mace +} // namespace benchmark +} // namespace mace -#endif // MACE_TOOLS_BENCHMARK_STAT_SUMMARIZER_H_ +#endif // MACE_BENCHMARK_STAT_SUMMARIZER_H_ diff --git a/mace/codegen/opencl/opencl_compiled_program.cc b/mace/codegen/opencl/opencl_compiled_program.cc index 35c5d6417e8e11205799f20c1d9d533eb13271a7..62fbad33022b92d4d72a7f407cca18c5e4073fe3 100644 --- a/mace/codegen/opencl/opencl_compiled_program.cc +++ b/mace/codegen/opencl/opencl_compiled_program.cc @@ -13,4 +13,4 @@ namespace mace { extern const std::map> kCompiledProgramMap = {}; -} // namespace +} // namespace mace diff --git a/mace/codegen/tuning/tuning_params.cc b/mace/codegen/tuning/tuning_params.cc index 12b5199bc2dcff7dab6bbd3fb68e0c9c7addd0f6..8a8b7132a26a150d14ff9504b13aa668fc109285 100644 --- a/mace/codegen/tuning/tuning_params.cc +++ b/mace/codegen/tuning/tuning_params.cc @@ -13,4 +13,4 @@ namespace mace { extern const std::map> kTuningParamsData = {}; -} // namespace +} // namespace mace diff --git a/mace/examples/mace_run.cc b/mace/examples/mace_run.cc index 68e986fb29470b61ebc9009fed7589c360a26f31..373b2455a3cba8e70911c652d04d94fd270834fb 100644 --- a/mace/examples/mace_run.cc +++ b/mace/examples/mace_run.cc @@ -16,8 +16,6 @@ */ #include #include -#include -#include #include #include #include @@ -28,9 +26,6 @@ #include "mace/utils/env_time.h" #include "mace/utils/logging.h" -using namespace std; -using namespace mace; - namespace mace { namespace MACE_MODEL_TAG { @@ -45,6 +40,8 @@ extern const std::string ModelChecksum(); } // namespace MACE_MODEL_TAG } // namespace mace +namespace mace { +namespace examples { namespace str_util { @@ -65,13 +62,13 @@ std::vector Split(const std::string &str, char delims) { } // namespace str_util -void ParseShape(const string &str, vector *shape) { - string tmp = str; +void ParseShape(const std::string &str, std::vector *shape) { + std::string tmp = str; while (!tmp.empty()) { int dim = atoi(tmp.data()); shape->push_back(dim); size_t next_offset = tmp.find(","); - if (next_offset == string::npos) { + if (next_offset == std::string::npos) { break; } else { tmp = tmp.substr(next_offset + 1); @@ -87,7 +84,7 @@ std::string FormatName(const std::string input) { return res; } -DeviceType ParseDeviceType(const string &device_str) { +DeviceType ParseDeviceType(const std::string &device_str) { if (device_str.compare("CPU") == 0) { return DeviceType::CPU; } else if (device_str.compare("NEON") == 0) { @@ -101,7 +98,7 @@ DeviceType ParseDeviceType(const string &device_str) { } } -GPUType ParseGPUType(const string &gpu_type_str) { +GPUType ParseGPUType(const std::string &gpu_type_str) { if (gpu_type_str.compare("ADRENO") == 0) { return GPUType::ADRENO; } else if (gpu_type_str.compare("MALI") == 0) { @@ -158,12 +155,18 @@ struct mallinfo LogMallinfoChange(struct mallinfo prev) { return curr; } -DEFINE_string(input_node, "input_node0,input_node1", "input nodes, separated by comma"); -DEFINE_string(input_shape, "1,224,224,3:1,1,1,10", "input shapes, separated by colon and comma"); -DEFINE_string(output_node, "output_node0,output_node1", "output nodes, separated by comma"); -DEFINE_string(output_shape, "1,224,224,2:1,1,1,10", "output shapes, separated by colon and comma"); -DEFINE_string(input_file, "", "input file name | input file prefix for multiple inputs."); -DEFINE_string(output_file, "", "output file name | output file prefix for multiple outputs"); +DEFINE_string(input_node, "input_node0,input_node1", + "input nodes, separated by comma"); +DEFINE_string(input_shape, "1,224,224,3:1,1,1,10", + "input shapes, separated by colon and comma"); +DEFINE_string(output_node, "output_node0,output_node1", + "output nodes, separated by comma"); +DEFINE_string(output_shape, "1,224,224,2:1,1,1,10", + "output shapes, separated by colon and comma"); +DEFINE_string(input_file, "", + "input file name | input file prefix for multiple inputs."); +DEFINE_string(output_file, "", + "output file name | output file prefix for multiple outputs"); DEFINE_string(model_data_file, "", "model data file name, used when EMBED_MODEL_DATA set to 0"); DEFINE_string(device, "OPENCL", "CPU/NEON/OPENCL/HEXAGON"); @@ -174,7 +177,8 @@ DEFINE_string(gpu_type, "ADRENO", "ADRENO/MALI"); DEFINE_int32(gpu_perf_hint, 2, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); DEFINE_int32(gpu_priority_hint, 1, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); DEFINE_int32(omp_num_threads, 8, "num of openmp threads"); -DEFINE_int32(cpu_power_option, 0, "0:DEFAULT/1:HIGH_PERFORMANCE/2:BATTERY_SAVE"); +DEFINE_int32(cpu_power_option, 0, + "0:DEFAULT/1:HIGH_PERFORMANCE/2:BATTERY_SAVE"); bool SingleInputAndOutput(const std::vector &input_shape, const std::vector &output_shape) { @@ -197,8 +201,7 @@ bool SingleInputAndOutput(const std::vector &input_shape, gpu_type, static_cast(FLAGS_gpu_perf_hint), static_cast(FLAGS_gpu_priority_hint)); - } - else if (device_type == DeviceType::CPU) { + } else if (device_type == DeviceType::CPU) { mace::ConfigOmpThreadsAndAffinity( FLAGS_omp_num_threads, static_cast(FLAGS_cpu_power_option)); @@ -227,7 +230,8 @@ bool SingleInputAndOutput(const std::vector &input_shape, std::unique_ptr output_data(new float[output_size]); // load input - ifstream in_file(FLAGS_input_file + "_" + FormatName(FLAGS_input_node), ios::in | ios::binary); + std::ifstream in_file(FLAGS_input_file + "_" + FormatName(FLAGS_input_node), + std::ios::in | std::ios::binary); if (in_file.is_open()) { in_file.read(reinterpret_cast(input_data.get()), input_size * sizeof(float)); @@ -262,7 +266,7 @@ bool SingleInputAndOutput(const std::vector &input_shape, if (output_data != nullptr) { std::string output_name = FLAGS_output_file + "_" + FormatName(FLAGS_output_node); - ofstream out_file(output_name, ios::binary); + std::ofstream out_file(output_name, std::ios::binary); out_file.write((const char *) (output_data.get()), output_size * sizeof(float)); out_file.flush(); @@ -279,10 +283,11 @@ bool SingleInputAndOutput(const std::vector &input_shape, return true; } -bool MultipleInputOrOutput(const std::vector &input_names, - const std::vector> &input_shapes, - const std::vector &output_names, - const std::vector> &output_shapes) { +bool MultipleInputOrOutput( + const std::vector &input_names, + const std::vector> &input_shapes, + const std::vector &output_names, + const std::vector> &output_shapes) { // load model int64_t t0 = NowMicros(); const unsigned char *model_data = @@ -302,8 +307,7 @@ bool MultipleInputOrOutput(const std::vector &input_names, gpu_type, static_cast(FLAGS_gpu_perf_hint), static_cast(FLAGS_gpu_priority_hint)); - } - else if (device_type == DeviceType::CPU) { + } else if (device_type == DeviceType::CPU) { mace::ConfigOmpThreadsAndAffinity( FLAGS_omp_num_threads, static_cast(FLAGS_cpu_power_option)); @@ -333,7 +337,8 @@ bool MultipleInputOrOutput(const std::vector &input_names, std::multiplies()); input_datas[i].reset(new float[input_size]); // load input - ifstream in_file(FLAGS_input_file + "_" + FormatName(input_names[i]), ios::in | ios::binary); + std::ifstream in_file(FLAGS_input_file + "_" + FormatName(input_names[i]), + std::ios::in | std::ios::binary); if (in_file.is_open()) { in_file.read(reinterpret_cast(input_datas[i].get()), input_size * sizeof(float)); @@ -377,8 +382,9 @@ bool MultipleInputOrOutput(const std::vector &input_names, } for (size_t i = 0; i < output_count; ++i) { - std::string output_name = FLAGS_output_file + "_" + FormatName(output_names[i]); - ofstream out_file(output_name, ios::binary); + std::string output_name = FLAGS_output_file + "_" + + FormatName(output_names[i]); + std::ofstream out_file(output_name, std::ios::binary); int64_t output_size = std::accumulate(output_shapes[i].begin(), output_shapes[i].end(), 1, std::multiplies()); @@ -395,7 +401,7 @@ bool MultipleInputOrOutput(const std::vector &input_names, return true; } -int main(int argc, char **argv) { +int Main(int argc, char **argv) { gflags::SetUsageMessage("some usage message"); gflags::ParseCommandLineFlags(&argc, &argv, true); @@ -419,14 +425,17 @@ int main(int argc, char **argv) { LOG(INFO) << "cpu_power_option: " << FLAGS_cpu_power_option; std::vector input_names = str_util::Split(FLAGS_input_node, ','); - std::vector output_names = str_util::Split(FLAGS_output_node, ','); - std::vector input_shapes = str_util::Split(FLAGS_input_shape, ':'); - std::vector output_shapes = str_util::Split(FLAGS_output_shape, ':'); + std::vector output_names = + str_util::Split(FLAGS_output_node, ','); + std::vector input_shapes = + str_util::Split(FLAGS_input_shape, ':'); + std::vector output_shapes = + str_util::Split(FLAGS_output_shape, ':'); const size_t input_count = input_shapes.size(); const size_t output_count = output_shapes.size(); - std::vector> input_shape_vec(input_count); - std::vector> output_shape_vec(output_count); + std::vector> input_shape_vec(input_count); + std::vector> output_shape_vec(output_count); for (size_t i = 0; i < input_count; ++i) { ParseShape(input_shapes[i], &input_shape_vec[i]); } @@ -447,9 +456,14 @@ int main(int argc, char **argv) { output_shape_vec); } } - if(ret) { + if (ret) { return 0; } else { return -1; } } + +} // namespace examples +} // namespace mace + +int main(int argc, char **argv) { mace::examples::Main(argc, argv); } diff --git a/mace/public/mace.h b/mace/public/mace.h index 3cf5f2973f313022230241aa5edfd11507ddd50f..725d262660f88d2a0ec046dc9d55ada2f836d05a 100644 --- a/mace/public/mace.h +++ b/mace/public/mace.h @@ -2,8 +2,8 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#ifndef MACE_CORE_MACE_H_ -#define MACE_CORE_MACE_H_ +#ifndef MACE_PUBLIC_MACE_H_ +#define MACE_PUBLIC_MACE_H_ #include #include @@ -169,7 +169,7 @@ class NodeInput { class OutputShape { public: OutputShape(); - OutputShape(const std::vector &dims); + OutputShape(const std::vector &dims); // NOLINT(runtime/explicit) void CopyFrom(const OutputShape &from); public: @@ -409,9 +409,10 @@ class MaceEngine { float *output, RunMetadata *run_metadata); // Multiple input or output - bool Run(const std::vector &input, - std::map &output, - RunMetadata *run_metadata = nullptr); + bool Run( + const std::vector &input, + std::map &output, // NOLINT(runtime/references) + RunMetadata *run_metadata = nullptr); MaceEngine(const MaceEngine &) = delete; MaceEngine &operator=(const MaceEngine &) = delete; @@ -425,4 +426,4 @@ class MaceEngine { } // namespace mace -#endif // MACE_CORE_MACE_H_ +#endif // MACE_PUBLIC_MACE_H_ diff --git a/mace/utils/command_line_flags.cc b/mace/utils/command_line_flags.cc index 83f8be3cd544e52fa441273bf60d4a0ccd7f28fb..e6b8041248a02ca07e20c62074233b2f23b2d663 100644 --- a/mace/utils/command_line_flags.cc +++ b/mace/utils/command_line_flags.cc @@ -3,32 +3,32 @@ // #include "mace/utils/command_line_flags.h" -#include "mace/utils/logging.h" #include #include -namespace mace { -namespace { +#include "mace/utils/logging.h" -using namespace std; +namespace mace { +namespace utils { -bool StringConsume(string &arg, const string &x) { - if ((arg.size() >= x.size()) && - (memcmp(arg.data(), x.data(), x.size()) == 0)) { - arg = arg.substr(x.size()); +bool StringConsume(const std::string &x, std::string *arg) { + MACE_CHECK_NOTNULL(arg); + if ((arg->size() >= x.size()) && + (memcmp(arg->data(), x.data(), x.size()) == 0)) { + *arg = arg->substr(x.size()); return true; } return false; } -bool ParseStringFlag(string arg, - string flag, - string *dst, +bool ParseStringFlag(std::string arg, + std::string flag, + std::string *dst, bool *value_parsing_ok) { *value_parsing_ok = true; - if (StringConsume(arg, "--") && StringConsume(arg, flag) && - StringConsume(arg, "=")) { + if (StringConsume("--", &arg) && StringConsume(flag, &arg) && + StringConsume("=", &arg)) { *dst = arg; return true; } @@ -36,13 +36,13 @@ bool ParseStringFlag(string arg, return false; } -bool ParseInt32Flag(string arg, - string flag, +bool ParseInt32Flag(std::string arg, + std::string flag, int32_t *dst, bool *value_parsing_ok) { *value_parsing_ok = true; - if (StringConsume(arg, "--") && StringConsume(arg, flag) && - StringConsume(arg, "=")) { + if (StringConsume("--", &arg) && StringConsume(flag, &arg) && + StringConsume("=", &arg)) { char extra; if (sscanf(arg.data(), "%d%c", dst, &extra) != 1) { LOG(ERROR) << "Couldn't interpret value " << arg << " for flag " << flag @@ -55,13 +55,13 @@ bool ParseInt32Flag(string arg, return false; } -bool ParseInt64Flag(string arg, - string flag, - long long *dst, +bool ParseInt64Flag(std::string arg, + std::string flag, + int64_t *dst, bool *value_parsing_ok) { *value_parsing_ok = true; - if (StringConsume(arg, "--") && StringConsume(arg, flag) && - StringConsume(arg, "=")) { + if (StringConsume("--", &arg) && StringConsume(flag, &arg) && + StringConsume("=", &arg)) { char extra; if (sscanf(arg.data(), "%lld%c", dst, &extra) != 1) { LOG(ERROR) << "Couldn't interpret value " << arg << " for flag " << flag @@ -74,9 +74,10 @@ bool ParseInt64Flag(string arg, return false; } -bool ParseBoolFlag(string arg, string flag, bool *dst, bool *value_parsing_ok) { +bool ParseBoolFlag(std::string arg, std::string flag, + bool *dst, bool *value_parsing_ok) { *value_parsing_ok = true; - if (StringConsume(arg, "--") && StringConsume(arg, flag)) { + if (StringConsume("--", &arg) && StringConsume(flag, &arg)) { if (arg.empty()) { *dst = true; return true; @@ -99,13 +100,13 @@ bool ParseBoolFlag(string arg, string flag, bool *dst, bool *value_parsing_ok) { return false; } -bool ParseFloatFlag(string arg, - string flag, +bool ParseFloatFlag(std::string arg, + std::string flag, float *dst, bool *value_parsing_ok) { *value_parsing_ok = true; - if (StringConsume(arg, "--") && StringConsume(arg, flag) && - StringConsume(arg, "=")) { + if (StringConsume("--", &arg) && StringConsume(flag, &arg) && + StringConsume("=", &arg)) { char extra; if (sscanf(arg.data(), "%f%c", dst, &extra) != 1) { LOG(ERROR) << "Couldn't interpret value " << arg << " for flag " << flag @@ -118,47 +119,48 @@ bool ParseFloatFlag(string arg, return false; } -} // namespace +} // namespace utils -Flag::Flag(const char *name, int *dst, const string &usage_text) +Flag::Flag(const char *name, int *dst, const std::string &usage_text) : name_(name), type_(TYPE_INT), int_value_(dst), usage_text_(usage_text) {} -Flag::Flag(const char *name, long long *dst, const string &usage_text) +Flag::Flag(const char *name, int64_t *dst, const std::string &usage_text) : name_(name), type_(TYPE_INT64), int64_value_(dst), usage_text_(usage_text) {} -Flag::Flag(const char *name, bool *dst, const string &usage_text) +Flag::Flag(const char *name, bool *dst, const std::string &usage_text) : name_(name), type_(TYPE_BOOL), bool_value_(dst), usage_text_(usage_text) {} -Flag::Flag(const char *name, string *dst, const string &usage_text) +Flag::Flag(const char *name, std::string *dst, const std::string &usage_text) : name_(name), type_(TYPE_STRING), string_value_(dst), usage_text_(usage_text) {} -Flag::Flag(const char *name, float *dst, const string &usage_text) +Flag::Flag(const char *name, float *dst, const std::string &usage_text) : name_(name), type_(TYPE_FLOAT), float_value_(dst), usage_text_(usage_text) {} -bool Flag::Parse(string arg, bool *value_parsing_ok) const { +bool Flag::Parse(std::string arg, bool *value_parsing_ok) const { bool result = false; if (type_ == TYPE_INT) { - result = ParseInt32Flag(arg, name_, int_value_, value_parsing_ok); + result = utils::ParseInt32Flag(arg, name_, int_value_, value_parsing_ok); } else if (type_ == TYPE_INT64) { - result = ParseInt64Flag(arg, name_, int64_value_, value_parsing_ok); + result = utils::ParseInt64Flag(arg, name_, int64_value_, value_parsing_ok); } else if (type_ == TYPE_BOOL) { - result = ParseBoolFlag(arg, name_, bool_value_, value_parsing_ok); + result = utils::ParseBoolFlag(arg, name_, bool_value_, value_parsing_ok); } else if (type_ == TYPE_STRING) { - result = ParseStringFlag(arg, name_, string_value_, value_parsing_ok); + result = utils::ParseStringFlag(arg, name_, + string_value_, value_parsing_ok); } else if (type_ == TYPE_FLOAT) { - result = ParseFloatFlag(arg, name_, float_value_, value_parsing_ok); + result = utils::ParseFloatFlag(arg, name_, float_value_, value_parsing_ok); } return result; } @@ -169,7 +171,7 @@ bool Flag::Parse(string arg, bool *value_parsing_ok) const { bool result = true; std::vector unknown_flags; for (int i = 1; i < *argc; ++i) { - if (string(argv[i]) == "--") { + if (std::string(argv[i]) == "--") { while (i < *argc) { unknown_flags.push_back(argv[i]); ++i; @@ -202,8 +204,8 @@ bool Flag::Parse(string arg, bool *value_parsing_ok) const { return result && (*argc < 2 || strcmp(argv[1], "--help") != 0); } -/*static*/ string Flags::Usage(const string &cmdline, - const std::vector &flag_list) { +std::string Flags::Usage(const std::string &cmdline, + const std::vector &flag_list) { std::stringstream usage_text; usage_text << "usage: " << cmdline << std::endl; diff --git a/mace/utils/command_line_flags.h b/mace/utils/command_line_flags.h index 4373ceedef7e58ad72ec86290dad103d5e6df992..3fa5a9e83cad1814c4dcb7eca4099e7f98a86a1d 100644 --- a/mace/utils/command_line_flags.h +++ b/mace/utils/command_line_flags.h @@ -2,8 +2,8 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#ifndef MACE_CORE_COMMAND_LINE_FLAGS_H -#define MACE_CORE_COMMAND_LINE_FLAGS_H +#ifndef MACE_UTILS_COMMAND_LINE_FLAGS_H_ +#define MACE_UTILS_COMMAND_LINE_FLAGS_H_ #include #include @@ -13,7 +13,7 @@ namespace mace { class Flag { public: Flag(const char *name, int *dst1, const std::string &usage_text); - Flag(const char *name, long long *dst1, const std::string &usage_text); + Flag(const char *name, int64_t *dst1, const std::string &usage_text); Flag(const char *name, bool *dst, const std::string &usage_text); Flag(const char *name, std::string *dst, const std::string &usage_text); Flag(const char *name, float *dst, const std::string &usage_text); @@ -26,7 +26,7 @@ class Flag { std::string name_; enum { TYPE_INT, TYPE_INT64, TYPE_BOOL, TYPE_STRING, TYPE_FLOAT } type_; int *int_value_; - long long *int64_value_; + int64_t *int64_value_; bool *bool_value_; std::string *string_value_; float *float_value_; @@ -50,4 +50,4 @@ class Flags { } // namespace mace -#endif // MACE_CORE_COMMAND_LINE_FLAGS_H +#endif // MACE_UTILS_COMMAND_LINE_FLAGS_H_ diff --git a/mace/utils/env_time.h b/mace/utils/env_time.h index ce70a244d3eb2942ead7cf8285d86845ce1d4e91..0fecab568e4a48ca138802e65d59142538946167 100644 --- a/mace/utils/env_time.h +++ b/mace/utils/env_time.h @@ -2,8 +2,8 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#ifndef MACE_UTILS_ENV_TIME_H -#define MACE_UTILS_ENV_TIME_H +#ifndef MACE_UTILS_ENV_TIME_H_ +#define MACE_UTILS_ENV_TIME_H_ #include #include @@ -19,4 +19,4 @@ inline int64_t NowMicros() { } // namespace mace -#endif // MACE_UTILS_ENV_TIME_H +#endif // MACE_UTILS_ENV_TIME_H_ diff --git a/mace/utils/logging.h b/mace/utils/logging.h index 22e39488b7bdd1a83a9d1c89cc6c74345bd751fd..4a6da3befb985a57d702a1766799722f6271bb36 100644 --- a/mace/utils/logging.h +++ b/mace/utils/logging.h @@ -9,6 +9,7 @@ #include #include #include +#include #include "mace/public/mace.h" #include "mace/utils/env_time.h" @@ -122,7 +123,7 @@ class LatencyLogger { VLOG(vlog_level_) << message_ << " latency: " << stop_micros - start_micros_ << " us"; } - }; + } private: const int vlog_level_; diff --git a/mace/utils/memory_logging.h b/mace/utils/memory_logging.h index e9d540bccc9ab14607dc39ca55d0ed4ca160d50f..bd46f58049d13ed6b7cbda455ad7c883a7e33f88 100644 --- a/mace/utils/memory_logging.h +++ b/mace/utils/memory_logging.h @@ -6,13 +6,15 @@ #define MACE_UTILS_MEMORY_LOGGING_H_ #include +#include + #include "mace/utils/logging.h" namespace mace { class MallinfoChangeLogger { public: - MallinfoChangeLogger(const std::string &name) : name_(name) { + explicit MallinfoChangeLogger(const std::string &name) : name_(name) { prev_ = mallinfo(); } ~MallinfoChangeLogger() { diff --git a/mace/utils/string_util.h b/mace/utils/string_util.h index aad884d3349f35d261a0292e4686baa9b16379a0..ee1b5918383e7c494c14299c95ea5cf8e6af132f 100644 --- a/mace/utils/string_util.h +++ b/mace/utils/string_util.h @@ -10,7 +10,7 @@ #include namespace mace { -namespace { +namespace string_util { inline void MakeStringInternal(std::stringstream & /*ss*/) {} @@ -27,12 +27,12 @@ inline void MakeStringInternal(std::stringstream &ss, MakeStringInternal(ss, args...); } -} // namespace +} // namespace string_util template std::string MakeString(const Args &... args) { std::stringstream ss; - MakeStringInternal(ss, args...); + string_util::MakeStringInternal(ss, args...); return ss.str(); } diff --git a/mace/utils/tuner.h b/mace/utils/tuner.h index fee8cd95a27dd27c3773d133c2c098bc8a2257e4..1b05f3a3199b04def2a8d17f255d0bb82a7acbae 100644 --- a/mace/utils/tuner.h +++ b/mace/utils/tuner.h @@ -17,8 +17,6 @@ #include "mace/utils/timer.h" #include "mace/utils/utils.h" -namespace {} // namespace - namespace mace { extern bool GetTuningParams( @@ -127,7 +125,7 @@ class Tuner { const std::function &, Timer *, std::vector *)> &func, - std::vector ¶ms, + const std::vector ¶ms, Timer *timer, int num_runs, double *time_us, diff --git a/mace/utils/tuner_development.cc b/mace/utils/tuner_development.cc index ccbe3b64fc5249e1de6e5885b169bb2af8f5be67..570b94cd465af7980a62d0e9eb92e10172c427fa 100644 --- a/mace/utils/tuner_development.cc +++ b/mace/utils/tuner_development.cc @@ -1,3 +1,6 @@ +// +// Copyright (c) 2017 XiaoMi All rights reserved. +// #include #include #include diff --git a/mace/utils/tuner_production.cc b/mace/utils/tuner_production.cc index f008d8dc52213d644f32d31a6efb68e37deef3a7..c45c6d7e1edd0d7a959bf63e61897b4e04aeb167 100644 --- a/mace/utils/tuner_production.cc +++ b/mace/utils/tuner_production.cc @@ -1,3 +1,6 @@ +// +// Copyright (c) 2017 XiaoMi All rights reserved. +// #include #include #include diff --git a/mace/utils/tuner_test.cc b/mace/utils/tuner_test.cc index 80cc50d08ab57b8601207d516afb31f3ca10a722..b040a5a62694e53f0792088080d3a7c644c4dd7d 100644 --- a/mace/utils/tuner_test.cc +++ b/mace/utils/tuner_test.cc @@ -1,7 +1,7 @@ // // Copyright (c) 2017 XiaoMi All rights reserved. // -#include +#include // NOLINT(build/c++11) #include "gtest/gtest.h" diff --git a/mace/utils/utils.h b/mace/utils/utils.h index 0330de47a052569a88855b3a976f61055e2c57ea..54ab5793d229bba9453ae38fae6ec260f3c9cb6e 100644 --- a/mace/utils/utils.h +++ b/mace/utils/utils.h @@ -7,6 +7,8 @@ #include #include +#include +#include namespace mace { template diff --git a/mace/utils/utils_test.cc b/mace/utils/utils_test.cc index 80cc50d08ab57b8601207d516afb31f3ca10a722..b040a5a62694e53f0792088080d3a7c644c4dd7d 100644 --- a/mace/utils/utils_test.cc +++ b/mace/utils/utils_test.cc @@ -1,7 +1,7 @@ // // Copyright (c) 2017 XiaoMi All rights reserved. // -#include +#include // NOLINT(build/c++11) #include "gtest/gtest.h"