Fixed coverity issues in samples (#10421)
* Fixed coverity issues * Fixed coverity isuues samples part 2 * Fixed code style * Delete goto * update after comments
This commit is contained in:
@@ -360,6 +360,7 @@ std::string get_test_info_stream_header(benchmark_app::InputInfo& inputInfo) {
|
||||
|
||||
std::map<std::string, ov::TensorVector> get_tensors(std::map<std::string, std::vector<std::string>> inputFiles,
|
||||
std::vector<benchmark_app::InputsInfo>& app_inputs_info) {
|
||||
std::ios::fmtflags fmt(std::cout.flags());
|
||||
std::map<std::string, ov::TensorVector> tensors;
|
||||
if (app_inputs_info.empty()) {
|
||||
throw std::logic_error("Inputs Info for network is empty!");
|
||||
@@ -515,6 +516,7 @@ std::map<std::string, ov::TensorVector> get_tensors(std::map<std::string, std::v
|
||||
slog::info << std::left << std::setw(maxNameWidth + 2) << inputLog.first << inputLog.second << slog::endl;
|
||||
}
|
||||
}
|
||||
std::cout.flags(fmt);
|
||||
|
||||
return tensors;
|
||||
}
|
||||
@@ -523,6 +525,7 @@ std::map<std::string, ov::TensorVector> get_tensors_static_case(const std::vecto
|
||||
const size_t& batchSize,
|
||||
benchmark_app::InputsInfo& app_inputs_info,
|
||||
size_t requestsNum) {
|
||||
std::ios::fmtflags fmt(std::cout.flags());
|
||||
std::map<std::string, ov::TensorVector> blobs;
|
||||
|
||||
std::vector<std::pair<size_t, size_t>> net_input_im_sizes;
|
||||
@@ -687,6 +690,7 @@ std::map<std::string, ov::TensorVector> get_tensors_static_case(const std::vecto
|
||||
slog::info << std::left << std::setw(maxNameWidth + 2) << inputLog.first << inputLog.second << slog::endl;
|
||||
}
|
||||
}
|
||||
std::cout.flags(fmt);
|
||||
|
||||
return blobs;
|
||||
}
|
||||
|
||||
@@ -243,8 +243,10 @@ const nlohmann::json StatisticsReportJSON::perf_counters_to_json(
|
||||
}
|
||||
|
||||
void LatencyMetrics::write_to_stream(std::ostream& stream) const {
|
||||
std::ios::fmtflags fmt(std::cout.flags());
|
||||
stream << data_shape << ";" << std::fixed << std::setprecision(2) << median_or_percentile << ";" << avg << ";"
|
||||
<< min << ";" << max;
|
||||
std::cout.flags(fmt);
|
||||
}
|
||||
|
||||
void LatencyMetrics::write_to_slog() const {
|
||||
|
||||
@@ -96,9 +96,9 @@ public:
|
||||
|
||||
std::string csv_name;
|
||||
std::string json_name;
|
||||
int i_val;
|
||||
double d_val;
|
||||
unsigned long long ull_val;
|
||||
int i_val = 0;
|
||||
double d_val = 0;
|
||||
unsigned long long ull_val = 0;
|
||||
std::string s_val;
|
||||
LatencyMetrics metrics_val;
|
||||
Type type;
|
||||
|
||||
Reference in New Issue
Block a user