Skip to content

Commit a95cf72

Browse files
authored
Merge branch 'master' into an/android-tbb-building
2 parents b9c5ba8 + ed9c4db commit a95cf72

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

src/core/dev_api/openvino/core/log_util.hpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,41 @@ bool is_verbose_logging();
520520
} \
521521
} while (0);
522522

523+
// pattern/op/block.cpp
524+
# define OPENVINO_LOG_BLOCK1(matcher, block_name) \
525+
do { \
526+
OPENVINO_LOG_MATCHING(matcher, \
527+
ov::util::LevelString::get()++, \
528+
OPENVINO_BLOCK_BODY_RIGHT, \
529+
" ENTERING BLOCK \"", \
530+
block_name, \
531+
"\":"); \
532+
} while (0);
533+
534+
# define OPENVINO_LOG_BLOCK2(matcher, block_name) \
535+
do { \
536+
OPENVINO_LOG_MATCHING(matcher, --ov::util::LevelString::get(), OPENVINO_BLOCK_BODY); \
537+
OPENVINO_LOG_MATCHING(matcher, \
538+
ov::util::LevelString::get(), \
539+
OPENVINO_BLOCK_END, \
540+
OPENVINO_GREEN, \
541+
" BLOCK \"", \
542+
block_name, \
543+
"\" MATCHED"); \
544+
} while (0);
545+
546+
# define OPENVINO_LOG_BLOCK3(matcher, block_name) \
547+
do { \
548+
OPENVINO_LOG_MATCHING(matcher, --ov::util::LevelString::get(), OPENVINO_BLOCK_BODY); \
549+
OPENVINO_LOG_MATCHING(matcher, \
550+
ov::util::LevelString::get(), \
551+
OPENVINO_BLOCK_END, \
552+
OPENVINO_RED, \
553+
" BLOCK \"", \
554+
block_name, \
555+
"\" DIDN'T MATCH"); \
556+
} while (0);
557+
523558
// pattern/op/wrap_type.cpp
524559
# define OPENVINO_LOG_WRAPTYPE1(matcher, pattern_value, graph_value) \
525560
do { \
@@ -742,6 +777,16 @@ bool is_verbose_logging();
742777
do { \
743778
} while (0)
744779

780+
# define OPENVINO_LOG_BLOCK1(...) \
781+
do { \
782+
} while (0)
783+
# define OPENVINO_LOG_BLOCK2(...) \
784+
do { \
785+
} while (0)
786+
# define OPENVINO_LOG_BLOCK3(...) \
787+
do { \
788+
} while (0)
789+
745790
# define OPENVINO_LOG_OPTIONAL1(...) \
746791
do { \
747792
} while (0)

src/core/include/openvino/pass/pattern/op/block.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (C) 2018-2026 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
15
#pragma once
26

37
#include <optional>

src/core/include/openvino/pass/pattern/op/block_util.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (C) 2018-2026 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
15
#pragma once
26

37
namespace {

src/core/src/pattern/op/block.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
// Copyright (C) 2018-2026 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
14

25
#include "openvino/pass/pattern/op/block.hpp"
36

7+
#include "openvino/core/log_util.hpp"
48
#include "openvino/core/rt_info.hpp"
9+
#include "openvino/util/log.hpp"
510

611
using namespace ov;
712
using namespace ov::pass::pattern;
@@ -19,8 +24,12 @@ bool Block::match_value(Matcher* matcher, const Output<Node>& pattern_value, con
1924
const auto& block_pattern_root = m_outputs.front();
2025

2126
// Using a local matcher to match only those patterns that are encapsulated into the current Block.
22-
auto local_matcher = std::make_shared<Matcher>(block_pattern_root.get_node_shared_ptr(), "BlockMatcher");
27+
// Inherit the parent matcher's name so that OV_MATCHERS_TO_LOG filtering applies inside the Block too.
28+
auto local_matcher = std::make_shared<Matcher>(block_pattern_root.get_node_shared_ptr(), matcher->get_name());
29+
30+
OPENVINO_LOG_BLOCK1(matcher, get_friendly_name());
2331
if (!local_matcher->match_value(block_pattern_root, graph_value)) {
32+
OPENVINO_LOG_BLOCK3(matcher, get_friendly_name());
2433
return false;
2534
}
2635

@@ -54,5 +63,7 @@ bool Block::match_value(Matcher* matcher, const Output<Node>& pattern_value, con
5463
matcher->add_node(matched_node_out);
5564
}
5665
}
66+
67+
OPENVINO_LOG_BLOCK2(matcher, get_friendly_name());
5768
return true;
5869
}

0 commit comments

Comments
 (0)