Replaced several cmake utilities with new ov_ prefix (#19819)

* Replaced several cmake utilities with new ov_ prefix

* Replaced several cmake utilities with new ov_ prefix
This commit is contained in:
Ilya Lavrenov authored and GitHub committed 2023-09-14 16:22:50 +04:00
1 parent d6ef6e253c
commit 35a0706dff
124 files changed
+433 -365

No files matched your search

+2 -2
View File
@@ -20,7 +20,7 @@ source_group("include" FILES ${PUBLIC_HEADERS})
add_library(${TARGET_NAME}_obj OBJECT ${LIBRARY_SRC} ${PUBLIC_HEADERS})
target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_OPENVINO_API)
ie_faster_build(${TARGET_NAME}_obj
ov_build_target_faster(${TARGET_NAME}_obj
UNITY
PCH PRIVATE "src/precomp.hpp"
)
@@ -30,7 +30,7 @@ target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::reference openvino::i
target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
"${CMAKE_CURRENT_SOURCE_DIR}/src")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_mark_target_as_cc(${TARGET_NAME}_obj)
@@ -278,6 +278,8 @@ bool ov::batch_util::detach_detection_output(const std::shared_ptr<ov::Model>& f
return !new_outputs.empty() || !outputs_to_delete.empty();
}
namespace {
std::map<std::shared_ptr<ov::op::v0::Parameter>, ov::PartialShape> collect_original_input_shapes(
const std::shared_ptr<ov::Model>& m) {
const auto& parameters = m->get_parameters();
@@ -291,6 +293,8 @@ std::map<std::shared_ptr<ov::op::v0::Parameter>, ov::PartialShape> collect_origi
return parameter_to_shape;
}
} // namespace
bool ov::pass::FindBatch::run_on_model(const std::shared_ptr<ov::Model>& m) {
RUN_ON_MODEL_SCOPE(FindBatch);
auto te = std::make_shared<ov::TableOfEquivalence>();
@@ -64,7 +64,7 @@ ov::pass::EliminateUnsqueezeGather::EliminateUnsqueezeGather() {
register_matcher(m, callback);
}
bool scalar_with_one_consumer(const Output<Node>& out) {
inline bool scalar_with_one_consumer(const Output<Node>& out) {
return rank_equals(0)(out) && consumers_count(1)(out);
}
@@ -264,6 +264,8 @@ bool ov::pass::GroupedStridedSliceOptimizer::run_on_model(const std::shared_ptr<
return graph_rewritten;
}
namespace {
struct SliceAttrs {
int64_t start, stop, axis;
};
@@ -318,6 +320,8 @@ bool slice_is_suitable_for_optimization(const std::shared_ptr<ov::op::v8::Slice>
return true;
}
} // namespace
bool ov::pass::GroupedSliceToVSplitOptimization::run_on_model(const std::shared_ptr<ov::Model>& model) {
RUN_ON_FUNCTION_SCOPE(GroupedSliceToVSplitOptimization);
bool graph_rewritten = false;
@@ -689,6 +689,8 @@ bool fuse_type_to_nms9(const std::shared_ptr<ov::Node>& node, const precisions_m
return res;
}
namespace {
bool update_type(size_t idx,
const std::shared_ptr<ov::Node>& node,
const precisions_map& precisions,
@@ -704,6 +706,8 @@ bool update_type(size_t idx,
return false;
}
} // namespace
bool fuse_type_to_matrix_nms(const std::shared_ptr<ov::Node>& node, const precisions_map& precisions) {
auto nms = ov::as_type_ptr<opset8::MatrixNms>(node);
if (!nms) {
@@ -52,6 +52,8 @@ using namespace std;
namespace ov {
namespace pass {
namespace {
void mark_reduceop_path(const std::shared_ptr<Node>& node) {
node->get_rt_info().emplace("reduceop_path", true);
}
@@ -77,7 +79,7 @@ void erase_fq_path(const std::shared_ptr<Node>& node) {
}
// Marking continues to propagate through these ops.
std::shared_ptr<Node> propagate_through_ops =
const std::shared_ptr<Node> propagate_through_ops =
pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v1::Reshape,
@@ -100,6 +102,8 @@ std::shared_ptr<Node> propagate_through_ops =
ov::op::v0::Constant,
ov::op::v0::Tile>();
} // namespace
/* After PropagateDownMark we need to go also once up to include side branches of ops with several args:
* Elementwise, Concat and so. E.g. if one of the argument of Concat was marked
* during PropagateDownMark we need also mark its other inputs and this is done in this PropagateUpMark pass.
@@ -367,30 +371,30 @@ public:
MATCHER_SCOPE(PropagateDownDisableSensitivityForQuantized);
// through this nodes
std::shared_ptr<Node> quantization_propagating_nodes = pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v0::FakeQuantize,
ov::op::v1::Reshape,
op::util::BroadcastBase,
ov::op::v0::DepthToSpace,
ov::op::v0::Interpolate,
ov::op::v4::Interpolate,
ov::op::v11::Interpolate,
ov::op::v1::MaxPool,
ov::op::v8::MaxPool,
op::util::PadBase,
ov::op::v1::ReduceMax,
ov::op::v1::ReduceMin,
ov::op::v0::Relu,
ov::op::v1::Transpose,
ov::op::v0::ShuffleChannels,
ov::op::v1::StridedSlice,
ov::op::v8::Slice,
ov::op::v1::VariadicSplit,
ov::op::v1::Split,
op::util::GatherBase,
ov::op::v0::Concat,
ov::op::v0::Tile>();
const std::shared_ptr<Node> quantization_propagating_nodes = pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v0::FakeQuantize,
ov::op::v1::Reshape,
op::util::BroadcastBase,
ov::op::v0::DepthToSpace,
ov::op::v0::Interpolate,
ov::op::v4::Interpolate,
ov::op::v11::Interpolate,
ov::op::v1::MaxPool,
ov::op::v8::MaxPool,
op::util::PadBase,
ov::op::v1::ReduceMax,
ov::op::v1::ReduceMin,
ov::op::v0::Relu,
ov::op::v1::Transpose,
ov::op::v0::ShuffleChannels,
ov::op::v1::StridedSlice,
ov::op::v8::Slice,
ov::op::v1::VariadicSplit,
ov::op::v1::Split,
op::util::GatherBase,
ov::op::v0::Concat,
ov::op::v0::Tile>();
matcher_pass_callback callback = [=](pattern::Matcher& m) {
const auto& node = m.get_match_root();
@@ -27,6 +27,8 @@
namespace ov {
namespace pass {
namespace {
/** \brief Check if output is rank one and data type can be i32 or i64. */
const auto is_rank_one_int_shape = [](const Output<Node>& output) -> bool {
return pattern::type_matches_any({element::i32, element::i64})(output) && pattern::has_static_shape()(output) &&
@@ -109,6 +111,8 @@ std::shared_ptr<Node> make_eye_batches(NodeRegistry& reg, const Output<Node>& ey
return reg.make<ov::op::v0::Tile>(eye, batch_repeats);
}
} // namespace
EyeDecomposition::EyeDecomposition() {
MATCHER_SCOPE(EyeDecomposition);
@@ -22,6 +22,8 @@
using namespace std;
namespace {
ov::Input<ov::Node> get_outer_input_of_ti_by_parameter(const shared_ptr<ov::op::v0::Parameter>& parameter,
const shared_ptr<ov::op::v0::TensorIterator>& ti) {
int64_t parameter_index = ti->get_body()->get_parameter_index(parameter);
@@ -154,6 +156,8 @@ bool relax_batch_for_initial_states_of_lstm(const shared_ptr<ov::op::v4::LSTMCel
return rewritten;
}
} // namespace
bool ov::pass::LSTMStatesBroadcast::run_on_model(const shared_ptr<ov::Model>& f) {
RUN_ON_FUNCTION_SCOPE(LSTMStatesBroadcast);
bool rewritten = false;
@@ -175,6 +175,9 @@ ov::Output<ov::Node> FixInputNodeRank(ov::Output<ov::Node> input_node,
} // namespace
namespace sink_forward {
namespace {
AxisVector AlignTransposeOrder(const Output<Node>& output, const TransposeInputsInfo& transpose_input_info) {
if (transpose_input_info.isEmpty()) {
return {};
@@ -197,6 +200,8 @@ AxisVector AlignTransposeOrder(const Output<Node>& output, const TransposeInputs
return new_transpose_order;
}
} // namespace
bool UpdateInputTransposes(const NodePtr& main_node,
const TransposeInputsInfo& transpose_input_info,
std::vector<size_t> input_indexes) {
@@ -4,6 +4,10 @@
set(TARGET_NAME ov_transformations_tests)
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ov_add_compiler_flags(-Wno-missing-declarations)
endif()
ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}