Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPU] Fix coverity scan issues in Node class #28268

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ void Node::selectPreferPrimitiveDescriptor(const std::vector<impl_desc_type>& pr
bool Node::isOneDimShape(const ov::PartialShape& pshape) {
int value_1_num = 0;
int sz = static_cast<int>(pshape.size());
for (auto s : pshape) {
for (const auto& s : pshape) {
if (s.is_static() && s.get_length() == 1) {
value_1_num++;
}
}
return value_1_num >= sz - 1;
}

bool Node::isReorderRequired(ov::intel_cpu::MemoryDescPtr desc1, ov::intel_cpu::MemoryDescPtr desc2) {
bool Node::isReorderRequired(const ov::intel_cpu::MemoryDescPtr& desc1, const ov::intel_cpu::MemoryDescPtr& desc2) {
bool samePrec = desc1->getPrecision() == desc2->getPrecision();
bool isOneDimShape1 = isOneDimShape(desc1->getShape().toPartialShape());
bool isOneDimShape2 = isOneDimShape(desc2->getShape().toPartialShape());
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ class Node {
void selectPreferPrimitiveDescriptor(const std::vector<impl_desc_type>& priority, bool ignoreConstInputs);
void selectPreferPrimitiveDescriptorWithShape(const std::vector<impl_desc_type>& priority, bool ignoreConstInputs);
bool isOneDimShape(const ov::PartialShape& pshape);
bool isReorderRequired(ov::intel_cpu::MemoryDescPtr desc1, ov::intel_cpu::MemoryDescPtr desc2);
bool isReorderRequired(const ov::intel_cpu::MemoryDescPtr& desc1, const ov::intel_cpu::MemoryDescPtr& desc2);
bool isConfigDefined(const NodeConfig& config) const;
virtual bool canBeInPlace() const;

Expand Down
Loading