Skip to content

Commit

Permalink
[apiConformance][TEMPLATE] Add too get_profiling_info info about ops (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalandi authored Oct 31, 2023
1 parent 8eee1b5 commit 65f6950
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/plugins/template/src/sync_infer_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "openvino/runtime/make_tensor.hpp"
#include "openvino/runtime/profiling_info.hpp"
#include "openvino/runtime/tensor.hpp"
#include "perf_counter.hpp"
#include "plugin.hpp"
#include "remote_tensor.hpp"
#include "template/remote_tensor.hpp"
Expand Down Expand Up @@ -268,9 +269,19 @@ std::vector<ov::ProfilingInfo> ov::template_plugin::InferRequest::get_profiling_
p_info.cpu_time = p_info.real_time = std::chrono::duration_cast<std::chrono::milliseconds>(time);
return p_info;
};

info.emplace_back(fill_profiling_info("input preprocessing", m_durations[Preprocess]));
info.emplace_back(fill_profiling_info("execution time", m_durations[StartPipeline]));
auto template_model = get_template_model();
for (const auto& op : template_model->get_runtime_model()->get_ops()) {
auto rt_info = op->get_rt_info();
const auto& it = rt_info.find(ov::runtime::interpreter::PERF_COUNTER_NAME);
OPENVINO_ASSERT(it != rt_info.end(), "Operation ", op, " doesn't contain performance counter");
auto counter = it->second.as<std::shared_ptr<ov::runtime::interpreter::PerfCounter>>();
info.emplace_back(fill_profiling_info(op->get_friendly_name(), counter->duration()));
}
info.emplace_back(fill_profiling_info("output postprocessing", m_durations[Postprocess]));

return info;
}
// ! [infer_request:get_profiling_info]
Expand Down

0 comments on commit 65f6950

Please sign in to comment.