From 845d10a99f552a21eab11ea595691beef51d3c29 Mon Sep 17 00:00:00 2001 From: zhou_chao1993 Date: Tue, 27 Apr 2021 19:22:27 +0800 Subject: [PATCH] modify deleter --- ge/graph/load/model_manager/davinci_model.cc | 14 +++++++------- ge/graph/manager/host_mem_manager.cc | 12 +++++------- metadef | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 81edd40b..49fd518d 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -280,7 +280,7 @@ void DavinciModel::UnbindHcomStream() { if (!all_hccl_stream_list_.empty()) { for (size_t i = 0; i < all_hccl_stream_list_.size(); i++) { GE_LOGW_IF(rtModelUnbindStream(rt_model_handle_, all_hccl_stream_list_[i]) != RT_ERROR_NONE, - "Unbind hccl stream from model failed! Index: %zu", i); + "Unbind hccl stream from model failed, Index: %zu", i); GE_LOGW_IF(rtStreamDestroy(all_hccl_stream_list_[i]) != RT_ERROR_NONE, "Destroy hccl stream for rt_model failed") } } @@ -551,7 +551,7 @@ Status DavinciModel::DoTaskSink() { } GE_CHK_RT_RET(rtGetAicpuDeploy(&deploy_type_)); - GELOGI("Do task_sink. AiCpu deploy type is: %x.", deploy_type_); + GELOGI("Do task sink. AiCpu deploy type is: %x.", deploy_type_); GE_CHK_STATUS_RET(BindModelStream(), "Bind model stream failed."); @@ -582,7 +582,7 @@ Status DavinciModel::SetTSDevice() { int64_t value = 0; bool ret = ge::AttrUtils::GetInt(ge_model_, ATTR_MODEL_CORE_TYPE, value); uint32_t core_type = ret ? static_cast(value) : 0; - GELOGD("SetTSDevice: %u.", core_type); + GELOGD("Set TSDevice: %u.", core_type); rtError_t rt_ret = rtSetTSDevice(core_type); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtSetTSDevice failed, core_type:%u, model_id:%u", @@ -969,7 +969,7 @@ Status DavinciModel::InitDataOp(const ComputeGraphPtr &graph, const NodePtr &nod return SUCCESS; } - GELOGI("Init Data node: %s.", op_desc->GetName().c_str()); + GELOGI("Init data node: %s.", op_desc->GetName().c_str()); auto data_index = data_op_index++; if (AttrUtils::GetInt(op_desc, ATTR_NAME_INDEX, data_index)) { GELOGD("Get new index %u, old %u", data_index, data_op_index - 1); @@ -1027,7 +1027,7 @@ Status DavinciModel::GenInputOutputInfo(const map &data_by_ GELOGD("Data node size: %zu, NetOutput node size: %zu", data_by_index.size(), output_op_list.size()); for (auto &item : data_by_index) { const auto output_addrs = ModelUtils::GetOutputDataAddrs(runtime_param_, item.second); - GELOGD("Data node: %s, output addr size: %zu", item.second->GetName().c_str(), output_addrs.size()); + GELOGD("Data node is: %s, output addr size: %zu", item.second->GetName().c_str(), output_addrs.size()); input_addrs_list_.emplace_back(output_addrs); GE_CHK_STATUS_RET(InitAippInfo(item.first, item.second), "Init AIPP Info failed"); @@ -1043,10 +1043,10 @@ Status DavinciModel::GenInputOutputInfo(const map &data_by_ vector out_node_name; (void)AttrUtils::GetListStr(ge_model_, ATTR_MODEL_OUT_NODES_NAME, out_node_name); - GELOGD("Output node size: %zu, out nodes name: %zu", output_op_list.size(), out_node_name.size()); + GELOGD("Output node size: %zu, out nodes name is: %zu", output_op_list.size(), out_node_name.size()); for (const auto &op_desc : output_op_list) { const auto input_addrs = ModelUtils::GetInputDataAddrs(runtime_param_, op_desc); - GELOGD("NetOutput node: %s, input addr size: %zu", op_desc->GetName().c_str(), input_addrs.size()); + GELOGD("NetOutput node is: %s, input addr size: %zu", op_desc->GetName().c_str(), input_addrs.size()); output_addrs_list_.emplace_back(input_addrs); bool getnext_sink_dynamic = false; diff --git a/ge/graph/manager/host_mem_manager.cc b/ge/graph/manager/host_mem_manager.cc index 9b57e413..2908df39 100644 --- a/ge/graph/manager/host_mem_manager.cc +++ b/ge/graph/manager/host_mem_manager.cc @@ -45,12 +45,11 @@ Status SharedMemAllocator::Allocate(SharedMemInfo &mem_info) { return GE_GRAPH_MEMORY_ALLOC_FAILED; } mem_info.fd = output_para.fd; - mem_info.host_aligned_ptr = AlignedPtr::BuildFromAllocFunc([&output_para](std::unique_ptr &ptr) { - ptr.reset(reinterpret_cast(output_para.ptr)); - }, - [](uint8_t *ptr) { - ptr = nullptr; - }); + mem_info.host_aligned_ptr = AlignedPtr::BuildFromAllocFunc( + [&output_para](std::unique_ptr &ptr) { + ptr.reset(reinterpret_cast(output_para.ptr)); + }, + [](uint8_t *ptr) { ptr = nullptr; }); mem_info.device_address = reinterpret_cast(output_para.devPtr); return SUCCESS; } @@ -93,7 +92,6 @@ void HostMemManager::Finalize() noexcept { } } var_memory_base_map_.clear(); - } Status HostMemManager::MallocSharedMemory(SharedMemInfo &mem_info) { diff --git a/metadef b/metadef index 22ab76ec..1c41e02f 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 22ab76ecd8461f679606374be4b3b6b6f7cad321 +Subproject commit 1c41e02f73b6e8f95369e052ee4de285145fb34f