Browse Source

!5033 clean codex

Merge pull request !5033 from caifubi/clean-codex
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
937861e011
2 changed files with 10 additions and 6 deletions
  1. +5
    -1
      mindspore/ccsrc/debug/common.cc
  2. +5
    -5
      mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc

+ 5
- 1
mindspore/ccsrc/debug/common.cc View File

@@ -119,7 +119,11 @@ std::optional<std::string> Common::GetConfigFile(const std::string &env) {
MS_LOG(ERROR) << dump_config_file << " not exist.";
return {};
}
auto suffix = dump_config_file.substr(dump_config_file.find_last_of('.') + 1);
auto point_pos = dump_config_file.find_last_of('.');
if (point_pos == std::string::npos) {
MS_LOG(EXCEPTION) << "Invalid json file name:" << dump_config_file;
}
auto suffix = dump_config_file.substr(point_pos + 1);
if (suffix != "json") {
MS_LOG(EXCEPTION) << "[DataDump] dump config file suffix only support json! But got:." << suffix;
}


+ 5
- 5
mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc View File

@@ -333,15 +333,15 @@ void DataDumper::RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, voi
MS_LOG(EXCEPTION) << "[DataDump] Protobuf SerializeToString failed, proto size %zu.";
}

rtError_t rt_ret = rtMalloc(ptr, proto_size, RT_MEMORY_HBM);
if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DataDump] Call rtMalloc failed";
}

if (ptr == nullptr) {
MS_LOG(ERROR) << "[DataDump] rtMalloc failed, ptr is nullptr";
return;
}

rtError_t rt_ret = rtMalloc(ptr, proto_size, RT_MEMORY_HBM);
if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DataDump] Call rtMalloc failed";
}
rt_ret = rtMemcpy(*ptr, proto_size, proto_str.c_str(), proto_size, RT_MEMCPY_HOST_TO_DEVICE);
if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DataDump] Call rtMemcpy failed";


Loading…
Cancel
Save