forked from mindspore-Ecosystem/mindspore
clean dump codex
This commit is contained in:
parent
cd88f58b88
commit
9ce7919712
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue