Fix build errors when building with enable_memory_profile (#11617)

This commit is contained in:
Ryan Hill 2022-05-25 10:08:33 -07:00 committed by GitHub
parent 6e65bac5c2
commit d03d7afef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -886,7 +886,7 @@ class PlannerImpl {
#if !defined(ORT_MINIMAL_BUILD) && defined(ORT_MEMORY_PROFILE)
size_t max_pc = plan_.execution_plan.size();
std::string node_arg_name;
ort_value_name_idx_map_.GetName(static_cast<int>(i), node_arg_name);
ORT_RETURN_IF_ERROR(ort_value_name_idx_map_.GetName(static_cast<int>(i), node_arg_name));
auto node_arg = graph_viewer_.GetNodeArg(node_arg_name);
plan_.allocation_plan[i].value_type = utils::GetMLDataType(*node_arg);
plan_.allocation_plan[i].life_interval = std::pair<size_t, size_t>(0, max_pc);

View file

@ -28,7 +28,7 @@ void MemoryInfo::GenerateTensorMap(const SequentialExecutionPlan* execution_plan
continue;
AllocInfoPerTensor mem_info;
mem_info.mlvalue_index = value_idx;
value_name_idx_map.GetName(mem_info.mlvalue_index, mem_info.mlvalue_name);
ORT_THROW_IF_ERROR(value_name_idx_map.GetName(mem_info.mlvalue_index, mem_info.mlvalue_name));
mem_info.lifetime_interval = execution_plan->allocation_plan[value_idx].life_interval;
mem_info.reused_buffer = (execution_plan->allocation_plan[value_idx].alloc_kind != AllocKind::kReuse) ? value_idx : execution_plan->allocation_plan[value_idx].reused_buffer;
//If the tensor is using memory outside of the scope, do not store it