[CPU][DEBUG_CAPS] Fix compilation warnings (#17977)
This commit is contained in:
parent
7b86b427cb
commit
36a4c0cb2b
@ -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(),
|
||||
" ",
|
||||
|
@ -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;
|
||||
|
@ -354,7 +354,7 @@ public:
|
||||
inplace = InPlaceType::Unknown;
|
||||
}
|
||||
|
||||
std::string getPrimitiveDescriptorType();
|
||||
std::string getPrimitiveDescriptorType() const;
|
||||
|
||||
PerfCount &PerfCounter() { return perfCounter; }
|
||||
|
||||
|
@ -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)
|
||||
@ -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;
|
||||
@ -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 - ?", "?");
|
||||
@ -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());
|
||||
@ -430,23 +430,23 @@ 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 = ",";
|
||||
}
|
||||
@ -454,7 +454,7 @@ std::ostream & operator<<(std::ostream & os, const PrintableModel& model) {
|
||||
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) {
|
||||
@ -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 = ",";
|
||||
}
|
||||
@ -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");
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -190,7 +190,7 @@ private:
|
||||
}
|
||||
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);
|
||||
|
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user