Browse Source

fix dump data compile bug

pull/15944/head
jianghui58 4 years ago
parent
commit
ca925f252a
2 changed files with 13 additions and 3 deletions
  1. +1
    -1
      mindspore/lite/CMakeLists.txt
  2. +12
    -2
      mindspore/lite/tools/benchmark/benchmark.cc

+ 1
- 1
mindspore/lite/CMakeLists.txt View File

@@ -132,7 +132,7 @@ if(SUPPORT_GPU STREQUAL vulkan)
include(${TOP_DIR}/cmake/external_libs/vulkan.cmake)
endif()

if(ENABLE_CONVERTER OR BUILD_MINDDATA STREQUAL "full" OR BUILD_MINDDATA STREQUAL "wrapper" OR PLATFORM_ARM)
if(ENABLE_CONVERTER OR BUILD_MINDDATA STREQUAL "full" OR BUILD_MINDDATA STREQUAL "wrapper" OR ENABLE_TOOLS)
include(${TOP_DIR}/cmake/external_libs/json.cmake)
endif()



+ 12
- 2
mindspore/lite/tools/benchmark/benchmark.cc View File

@@ -1050,8 +1050,18 @@ int Benchmark::InitDumpConfigFromJson(char *path) {
}
}

dump_file_output_dir_ = dump_cfg_json_[dump::kSettings][dump::kPath].get<std::string>() + "/" +
dump_cfg_json_[dump::kSettings][dump::kNetName].get<std::string>();
auto abs_path = dump_cfg_json_[dump::kSettings][dump::kPath].get<std::string>();
auto net_name = dump_cfg_json_[dump::kSettings][dump::kNetName].get<std::string>();
if (abs_path.back() == '\\' || abs_path.back() == '/') {
dump_file_output_dir_ = abs_path + net_name;
} else {
#ifdef _WIN32
dump_file_output_dir_ = abs_path + "\\" + net_name;
#else
dump_file_output_dir_ = abs_path + "/" + net_name;
#endif
}

auto status = CreateOutputDir(&dump_file_output_dir_);
if (status != RET_OK) {
MS_LOG(ERROR) << "create data output directory failed.";


Loading…
Cancel
Save