Added -Wall for Clang and GCC (#15513)
* Added -Wall for Clang and GCC * Fixes * Don't use /J * Fixed warnings * Fixed warnings * More fixes * Fixed for MSVC * Fixed more warnings on Windows * Suppressed some warnings in template plugin * Update src/tests/functional/plugin/shared/include/behavior/plugin/caching_tests.hpp * Added suppression for PT FE * Suppressed warnings in TF FE * Suppressed warnings on Core unit tests * Suppress warnings in python * Suppressed Windows warning for 3rd party modules * Suppresed one more warning
This commit is contained in:
1 parent
6b503099db
commit
1f3e469c5e
312 files changed
+1261
-1290
No files matched your search
@@ -169,7 +169,7 @@ ov::Tensor create_tensor_from_binary(const std::vector<std::string>& files,
|
||||
if (inputInfo.layout != "CN") {
|
||||
binaryFile.read(&data[b * inputSize], inputSize);
|
||||
} else {
|
||||
for (int i = 0; i < inputInfo.channels(); i++) {
|
||||
for (size_t i = 0; i < inputInfo.channels(); i++) {
|
||||
binaryFile.read(&data[(i * binaryBatchSize + b) * sizeof(T)], sizeof(T));
|
||||
}
|
||||
}
|
||||
@@ -517,7 +517,7 @@ std::map<std::string, ov::TensorVector> get_tensors(std::map<std::string, std::v
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < logOutput.size(); i++) {
|
||||
for (size_t i = 0; i < logOutput.size(); i++) {
|
||||
slog::info << "Test Config " << i << slog::endl;
|
||||
auto maxNameWidth = std::max_element(logOutput[i].begin(),
|
||||
logOutput[i].end(),
|
||||
@@ -691,7 +691,7 @@ std::map<std::string, ov::TensorVector> get_tensors_static_case(const std::vecto
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < logOutput.size(); i++) {
|
||||
for (size_t i = 0; i < logOutput.size(); i++) {
|
||||
slog::info << "Test Config " << i << slog::endl;
|
||||
auto maxNameWidth = std::max_element(logOutput[i].begin(),
|
||||
logOutput[i].end(),
|
||||
|
||||
@@ -176,9 +176,9 @@ void setDeviceProperty(ov::Core& core,
|
||||
return;
|
||||
|
||||
if (device_config.find(device) == device_config.end() || // device properties not existed
|
||||
config.first.empty() && // not setting default value to property
|
||||
(!FLAGS_load_config.empty() &&
|
||||
is_dev_set_property[device])) { // device properties loaded from file and overwrite is not happened
|
||||
(config.first.empty() && // not setting default value to property
|
||||
(!FLAGS_load_config.empty() &&
|
||||
is_dev_set_property[device]))) { // device properties loaded from file and overwrite is not happened
|
||||
is_dev_set_property[device] = false;
|
||||
device_config.erase(device);
|
||||
device_config.insert(ov::device::properties(device, device_property));
|
||||
@@ -206,7 +206,7 @@ void fuse_mean_scale(ov::preprocess::PrePostProcessor& preproc, const benchmark_
|
||||
bool warned = false;
|
||||
constexpr char warn_msg[] = "Mean/scale values are fused into the model. This slows down performance compared to "
|
||||
"--imean and --iscale which existed before";
|
||||
for (const std::pair<std::string, benchmark_app::InputInfo>& input_info : app_inputs_info) {
|
||||
for (const std::pair<std::string, benchmark_app::InputInfo> input_info : app_inputs_info) {
|
||||
if (!input_info.second.mean.empty()) {
|
||||
if (!warned) {
|
||||
slog::warn << warn_msg << slog::endl;
|
||||
@@ -742,7 +742,7 @@ int main(int argc, char* argv[]) {
|
||||
const auto output_precision = FLAGS_op.empty() ? ov::element::undefined : getPrecision2(FLAGS_op);
|
||||
|
||||
const auto& inputs = model->inputs();
|
||||
for (int i = 0; i < inputs.size(); i++) {
|
||||
for (size_t i = 0; i < inputs.size(); i++) {
|
||||
const auto& item = inputs[i];
|
||||
auto iop_precision = ov::element::undefined;
|
||||
auto type_to_set = ov::element::undefined;
|
||||
@@ -783,7 +783,7 @@ int main(int argc, char* argv[]) {
|
||||
fuse_mean_scale(preproc, app_inputs_info.at(0));
|
||||
|
||||
const auto& outs = model->outputs();
|
||||
for (int i = 0; i < outs.size(); i++) {
|
||||
for (size_t i = 0; i < outs.size(); i++) {
|
||||
const auto& item = outs[i];
|
||||
auto iop_precision = ov::element::undefined;
|
||||
try {
|
||||
@@ -1215,7 +1215,7 @@ int main(int argc, char* argv[]) {
|
||||
std::vector<LatencyMetrics> groupLatencies = {};
|
||||
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
|
||||
const auto& lat_groups = inferRequestsQueue.get_latency_groups();
|
||||
for (int i = 0; i < lat_groups.size(); i++) {
|
||||
for (size_t i = 0; i < lat_groups.size(); i++) {
|
||||
const auto& lats = lat_groups[i];
|
||||
|
||||
std::string data_shapes_string = "";
|
||||
|
||||
@@ -83,7 +83,7 @@ std::map<std::string, ov::TensorVector> get_remote_input_tensors(
|
||||
auto& oclContext = static_cast<ov::intel_gpu::ocl::ClContext&>(context);
|
||||
auto oclInstance = std::make_shared<gpu::OpenCL>(oclContext.get());
|
||||
|
||||
for (int i = 0; i < num_requests; i++) {
|
||||
for (size_t i = 0; i < num_requests; i++) {
|
||||
for (auto& inputs_info : app_inputs_info) {
|
||||
for (auto& input : inputs_info) {
|
||||
// Fill random
|
||||
|
||||
@@ -84,7 +84,7 @@ void StatisticsReport::dump_performance_counters_request(CsvDumper& dumper, cons
|
||||
|
||||
for (const auto& layer : perfCounts) {
|
||||
dumper << layer.node_name; // layer name
|
||||
dumper << ((int)layer.status < (sizeof(status_names) / sizeof(status_names[0]))
|
||||
dumper << ((size_t)layer.status < (sizeof(status_names) / sizeof(status_names[0]))
|
||||
? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
dumper << layer.node_type << layer.exec_type;
|
||||
@@ -107,7 +107,6 @@ void StatisticsReport::dump_sort_performance_counters_request(CsvDumper& dumper,
|
||||
const PerformanceCounters& perfCounts) {
|
||||
std::chrono::microseconds total = std::chrono::microseconds::zero();
|
||||
std::chrono::microseconds total_cpu = std::chrono::microseconds::zero();
|
||||
int layersize = 0;
|
||||
|
||||
dumper << "layerName"
|
||||
<< "execStatus"
|
||||
@@ -131,14 +130,13 @@ void StatisticsReport::dump_sort_performance_counters_request(CsvDumper& dumper,
|
||||
for (const auto& layer : profiling) {
|
||||
if (std::string(status_names[(int)layer.status]).compare("EXECUTED") == 0) {
|
||||
dumper << layer.node_name; // layer name
|
||||
dumper << ((int)layer.status < (sizeof(status_names) / sizeof(status_names[0]))
|
||||
dumper << ((size_t)layer.status < (sizeof(status_names) / sizeof(status_names[0]))
|
||||
? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
dumper << layer.node_type << layer.exec_type;
|
||||
dumper << layer.real_time.count() / 1000.0 << layer.cpu_time.count() / 1000.0;
|
||||
dumper << (layer.real_time * 1.0 / total) * 100;
|
||||
dumper.endLine();
|
||||
layersize += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +157,7 @@ StatisticsReport::PerformanceCounters StatisticsReport::get_average_performance_
|
||||
// iterate over each layer from sorted vector and add required PM data
|
||||
// to the per-layer maps
|
||||
for (const auto& pm : perfCounts[i]) {
|
||||
int idx = 0;
|
||||
size_t idx = 0;
|
||||
for (; idx < performanceCountersAvg.size(); idx++) {
|
||||
if (performanceCountersAvg[idx].node_name == pm.node_name) {
|
||||
performanceCountersAvg[idx].real_time += pm.real_time;
|
||||
@@ -284,8 +282,8 @@ const nlohmann::json StatisticsReportJSON::perf_counters_to_json(
|
||||
|
||||
item["name"] = layer.node_name; // layer name
|
||||
item["status"] =
|
||||
((int)layer.status < (sizeof(status_names) / sizeof(status_names[0])) ? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
((size_t)layer.status < (sizeof(status_names) / sizeof(status_names[0])) ? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
item["node_type"] = layer.node_type;
|
||||
item["exec_type"] = layer.exec_type;
|
||||
item["real_time"] = layer.real_time.count() / 1000.0;
|
||||
@@ -320,8 +318,8 @@ const nlohmann::json StatisticsReportJSON::sort_perf_counters_to_json(
|
||||
nlohmann::json item;
|
||||
item["name"] = layer.node_name; // layer name
|
||||
item["status"] =
|
||||
((int)layer.status < (sizeof(status_names) / sizeof(status_names[0])) ? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
((size_t)layer.status < (sizeof(status_names) / sizeof(status_names[0])) ? status_names[(int)layer.status]
|
||||
: "INVALID_STATUS");
|
||||
item["node_type"] = layer.node_type;
|
||||
item["exec_type"] = layer.exec_type;
|
||||
item["real_time"] = layer.real_time.count() / 1000.0;
|
||||
|
||||
@@ -527,7 +527,7 @@ std::vector<benchmark_app::InputsInfo> get_inputs_info(const std::string& shape_
|
||||
}
|
||||
|
||||
info.dataShape = ov::Shape(info.partialShape.size(), 0);
|
||||
for (int i = 0; i < info.partialShape.size(); i++) {
|
||||
for (size_t i = 0; i < info.partialShape.size(); i++) {
|
||||
auto& dim = info.partialShape[i];
|
||||
if (dim.is_static()) {
|
||||
info.dataShape[i] = dim.get_length();
|
||||
|
||||
@@ -41,7 +41,7 @@ std::shared_ptr<unsigned char> OCVReader::getData(size_t width = 0, size_t heigh
|
||||
|
||||
cv::Mat resized(cv::Size(width, height), img.type(), _data.get());
|
||||
|
||||
if (width != img.cols || height != img.rows) {
|
||||
if (width != static_cast<size_t>(img.cols) || height != static_cast<size_t>(img.rows)) {
|
||||
slog::warn << "Image is resized from (" << img.cols << ", " << img.rows << ") to (" << width << ", " << height
|
||||
<< ")" << slog::endl;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void printInputAndOutputsInfo(const ov::Model& network) {
|
||||
slog::info << "model name: " << network.get_friendly_name() << slog::endl;
|
||||
|
||||
const std::vector<ov::Output<const ov::Node>> inputs = network.inputs();
|
||||
for (const ov::Output<const ov::Node> input : inputs) {
|
||||
for (const ov::Output<const ov::Node>& input : inputs) {
|
||||
slog::info << " inputs" << slog::endl;
|
||||
|
||||
const std::string name = input.get_names().empty() ? "NONE" : input.get_any_name();
|
||||
@@ -185,7 +185,7 @@ void printInputAndOutputsInfo(const ov::Model& network) {
|
||||
}
|
||||
|
||||
const std::vector<ov::Output<const ov::Node>> outputs = network.outputs();
|
||||
for (const ov::Output<const ov::Node> output : outputs) {
|
||||
for (const ov::Output<const ov::Node>& output : outputs) {
|
||||
slog::info << " outputs" << slog::endl;
|
||||
|
||||
const std::string name = output.get_names().empty() ? "NONE" : output.get_any_name();
|
||||
|
||||
@@ -70,7 +70,7 @@ ov::Tensor read_weights(const std::string& filepath) {
|
||||
ov::Tensor weights(ov::element::u8, {static_cast<size_t>(fileSize)});
|
||||
read_file(filepath, weights.data(), weights.get_byte_size());
|
||||
|
||||
return std::move(weights);
|
||||
return weights;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,7 +126,7 @@ int main(int argc, char* argv[]) {
|
||||
in.model().set_layout(ov::Layout(custom_layouts.at(item_name)));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < model->outputs().size(); i++) {
|
||||
for (size_t i = 0; i < model->outputs().size(); i++) {
|
||||
proc.output(i).tensor().set_element_type(ov::element::f32);
|
||||
}
|
||||
model = proc.build();
|
||||
|
||||
Reference in new issue
Block a user