Skip to content

Commit

Permalink
[CPU][DEBUG_CAPS] Fix compilation warnings (#17977)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDuplensky authored Jun 9, 2023
1 parent 7b86b42 commit 36a4c0c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void Graph::InitDescriptors() {

#ifdef CPU_DEBUG_CAPS
const auto& SPDs = node->getSupportedPrimitiveDescriptors();
for (int i = 0; i < SPDs.size(); i++) {
for (size_t i = 0; i < SPDs.size(); i++) {
DEBUG_LOG("#",
node->getExecIndex(),
" ",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ MemoryDescPtr Node::getBaseMemDescAtOutputPort(size_t portNum) const {
IE_THROW() << "Can't get output memory desc, primitive descriptor is not selected";
}

std::string Node::getPrimitiveDescriptorType() {
std::string Node::getPrimitiveDescriptorType() const {
auto selectedPrimitiveDesc = getSelectedPrimitiveDescriptor();

impl_desc_type type = impl_desc_type::undef;
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 @@ -354,7 +354,7 @@ class Node {
inplace = InPlaceType::Unknown;
}

std::string getPrimitiveDescriptorType();
std::string getPrimitiveDescriptorType() const;

PerfCount &PerfCounter() { return perfCounter; }

Expand Down
24 changes: 12 additions & 12 deletions src/plugins/intel_cpu/src/utils/debug_capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ DebugLogEnabled::DebugLogEnabled(const char* file, const char* func, int line, c

bool match = false;
const char* p0 = p_filters;
const char* p1;
const char* p1 = p0;
while (*p0 != 0) {
p1 = p0;
while (*p1 != ';' && *p1 != 0)
Expand Down Expand Up @@ -163,7 +163,7 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) {
std::stringstream leftside;

int num_output_port = 0;
for (auto wptr : node.getChildEdges()) {
for (const auto& wptr : node.getChildEdges()) {
auto edge = wptr.lock();
if (num_output_port < edge->getInputNum() + 1)
num_output_port = edge->getInputNum() + 1;
Expand All @@ -190,7 +190,7 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) {
leftside << "(empty)";
}
}
if (!b_ouputed && nodeDesc && i < nodeDesc->getConfig().outConfs.size()) {
if (!b_ouputed && nodeDesc && i < static_cast<int>(nodeDesc->getConfig().outConfs.size())) {
auto desc = nodeDesc->getConfig().outConfs[i].getMemDesc();
auto shape_str = desc->getShape().toString();
replace_all(shape_str, "0 - ?", "?");
Expand Down Expand Up @@ -258,12 +258,12 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) {
os << " (";

comma = "";
for (int port = 0; port < node.getParentEdges().size(); ++port) {
for (size_t port = 0; port < node.getParentEdges().size(); ++port) {
// find the Parent edge connecting to port
for (const auto & e : node.getParentEdges()) {
auto edge = e.lock();
if (!edge) continue;
if (edge->getOutputNum() != port) continue;
if (edge->getOutputNum() != static_cast<int>(port)) continue;
auto n = edge->getParent();
os << comma;
os << node_id(*edge->getParent());
Expand Down Expand Up @@ -430,31 +430,31 @@ std::ostream & operator<<(std::ostream & os, const PrintableModel& model) {
OstreamAttributeVisitor osvis(os);
std::string sep = "";
os << prefix;
for (auto op : f.get_results()) {
for (const auto& op : f.get_results()) {
os << sep << op->get_name();
sep = ",";
}
os << " " << f.get_friendly_name() << "(\n" << prefix;
for (auto op : f.get_parameters()) {
for (const auto& op : f.get_parameters()) {
os << "\t" << tag << op->get_friendly_name() << ",\n" << prefix;
}
os << ") {\n";
for (auto op : f.get_ordered_ops()) {
for (const auto& op : f.get_ordered_ops()) {
auto type = op->get_type_name();
auto name = op->get_friendly_name();
os << prefix << "\t";
if (op->get_output_size() > 1)
os << "(";
sep = "";
for (int i = 0; i < op->get_output_size(); i++) {
for (size_t i = 0; i < op->get_output_size(); i++) {
os << sep << op->get_output_element_type(i) << "_" << op->get_output_partial_shape(i);
sep = ",";
}
if (op->get_output_size() > 1)
os << ")";
os << " " << tag << name << " = " << type << "(";
sep = "";
for (int i = 0; i < op->get_input_size(); i++) {
for (size_t i = 0; i < op->get_input_size(); i++) {
auto vout = op->get_input_source_output(i);
auto iop = vout.get_node_shared_ptr();
if (iop->get_output_size() > 1) {
Expand All @@ -477,7 +477,7 @@ std::ostream & operator<<(std::ostream & os, const PrintableModel& model) {
auto sz = shape_size(constop->get_shape());
if (sz < 9) {
sep = "";
for (auto v : constop->get_value_strings()) {
for (const auto& v : constop->get_value_strings()) {
os << sep << v;
sep = ",";
}
Expand All @@ -494,7 +494,7 @@ std::ostream & operator<<(std::ostream & os, const PrintableModel& model) {
// recursively output subgraphs
if (auto msubgraph = std::dynamic_pointer_cast<op::util::MultiSubGraphOp>(op)) {
auto cnt = msubgraph->get_internal_subgraphs_size();
for (int i = 0; i < cnt; i++) {
for (size_t i = 0; i < cnt; i++) {
os << "\t\t MultiSubGraphOp " << tag << msubgraph->get_friendly_name() << "[" << i << "]" << std::endl;
os << PrintableModel(*msubgraph->get_function(i).get(), tag, prefix + "\t\t");
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/utils/debug_capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ template<typename T>
std::ostream & operator<<(std::ostream & os, const PrintableVector<T>& vec) {
std::stringstream ss;
auto N = vec.values.size();
for (int i = 0; i < N; i++) {
for (size_t i = 0; i < N; i++) {
if (i > 0)
ss << ",";
if (ss.tellp() > vec.maxsize) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/utils/debug_caps_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class DebugCapsConfig {
}
std::string getPropertyValueDescription(void) const override {
std::string supportedTokens = "comma separated filter tokens: ";
for (auto i = 0; i < propertyTokens.size(); i++) {
for (size_t i = 0; i < propertyTokens.size(); i++) {
if (i)
supportedTokens.push_back(',');
supportedTokens.append(propertyTokens[i].name);
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/utils/verbose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ void Verbose::printInfo() {
shift(written);
};

for (int i = 0; i < node->getParentEdges().size(); i++) {
for (size_t i = 0; i < node->getParentEdges().size(); i++) {
std::string prefix("src:" + std::to_string(i) + ':');
formatMemDesc(MemoryDescUtils::convertToDnnlMemoryDesc(
node->getParentEdgeAt(i)->getMemory().getDesc().clone())->getDnnlDesc().get(),
prefix);
}

for (int i = 0; i < node->getChildEdges().size(); i++) {
for (size_t i = 0; i < node->getChildEdges().size(); i++) {
std::string prefix("dst:" + std::to_string(i) + ':');
formatMemDesc(MemoryDescUtils::convertToDnnlMemoryDesc(
node->getChildEdgeAt(i)->getMemory().getDesc().clone())->getDnnlDesc().get(),
Expand Down

0 comments on commit 36a4c0c

Please sign in to comment.