[Gna][coverity] fixes for issue type AUTO_CAUSES_COPY (#17192)
* [Gna][coverity] fixes for AUTO_CAUSES_COPY CID: 1491505, 1491595, 1502494, 1502500, 1504698, 1504769, 1507058 * update afte review * adding const specifier to auto where needed
This commit is contained in:
@@ -191,8 +191,8 @@ inline void UnorderedDFS(std::unordered_set<CNNLayer*>& visited,
|
||||
visited.insert(cnnLayer.get());
|
||||
|
||||
// visit children
|
||||
for (auto& od : cnnLayer->outData) {
|
||||
for (auto nl : getInputTo(od)) {
|
||||
for (const auto& od : cnnLayer->outData) {
|
||||
for (const auto& nl : getInputTo(od)) {
|
||||
layers.push(nl.second);
|
||||
}
|
||||
}
|
||||
@@ -612,7 +612,7 @@ inline CNNNetwork CNNNetCopy(const CNNNetwork& input, const Copier& cp) {
|
||||
InputsDataMap inputsInfo = input.getInputsInfo();
|
||||
std::set<DataPtr> insDatas;
|
||||
for (auto&& info : inputsInfo) {
|
||||
for (auto secondLayer : getInputTo(info.second->getInputData())) {
|
||||
for (const auto& secondLayer : getInputTo(info.second->getInputData())) {
|
||||
auto secondLayerNew = oldToNewLayers[secondLayer.second.get()];
|
||||
InputInfo::Ptr infoNew = std::make_shared<InputInfo>();
|
||||
infoNew->setInputData(
|
||||
|
||||
@@ -162,11 +162,11 @@ void GNAInferRequest::CreateInferRequest() {
|
||||
}
|
||||
|
||||
// copy inputs blobs since we need to have them in separate address space to allow simultaneous infer requests
|
||||
for (auto output : _networkOutputs) {
|
||||
for (const auto& output : _networkOutputs) {
|
||||
_outputs[output.first] = plg->GetOutputBlob(output.first, output.second->getTensorDesc().getPrecision());
|
||||
}
|
||||
|
||||
for (auto input : _networkInputs) {
|
||||
for (const auto& input : _networkInputs) {
|
||||
_inputs[input.first] = plg->GetInputBlob(input.first, input.second->getTensorDesc().getPrecision());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ void GNAPlugin::PrePostProcess(InferenceEngine::Blob::Ptr input_blob,
|
||||
const ov::Shape& input_shape = input_blob->getTensorDesc().getDims();
|
||||
const ov::Shape& output_shape = output_blob->getTensorDesc().getDims();
|
||||
|
||||
for (auto param : model->get_parameters()) {
|
||||
for (const auto& param : model->get_parameters()) {
|
||||
param->set_element_type(input_type);
|
||||
}
|
||||
model->validate_nodes_and_infer_types();
|
||||
|
||||
@@ -823,7 +823,7 @@ void RemovePermutationsNHWCToNCHWPass::run() {
|
||||
!getInputTo(pattern_start->outData.front()).empty()) {
|
||||
auto layer_before_permute = CNNNetPrevLayer(pattern_start);
|
||||
DataPtr output = nullptr;
|
||||
for (auto before_output : layer_before_permute->outData) {
|
||||
for (const auto& before_output : layer_before_permute->outData) {
|
||||
if (areEqualDatas(pattern_start->input(), before_output)) {
|
||||
output = before_output;
|
||||
output->setLayout(getTransposedLayout(output));
|
||||
@@ -1024,7 +1024,7 @@ void InsertCopyLayerPass::run() {
|
||||
LayerInfo(l).isSplit()) {
|
||||
std::vector<FuncChildrenInfo> copy_insertion_tuples;
|
||||
std::vector<FuncChildrenInfo> delayed_copy_insertion_tuples;
|
||||
for (auto output : l->outData) {
|
||||
for (const auto& output : l->outData) {
|
||||
auto& inputTo = getInputTo(output);
|
||||
for (auto& childLayer : inputTo) {
|
||||
std::vector<int> connections = CNNLayerFindInsDataIdxes(output, childLayer.second);
|
||||
|
||||
Reference in New Issue
Block a user