From 28eed7708e76dfa605f3078935244527d783d0ac Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Fri, 4 Sep 2020 06:06:43 +0300 Subject: [PATCH] Removed builders from public API (#2059) * Removed builders from public API * Fixed build --- .../src/transformations/CMakeLists.txt | 2 +- .../fc_bias_fusion.hpp | 1 - .../reshape_fc_fusion.hpp | 1 - .../src/ngraph_ops/fully_connected.cpp | 4 -- ngraph/core/CMakeLists.txt | 4 +- ngraph/core/builder/CMakeLists.txt | 44 +++++++++++++++++++ .../include/ngraph/builder/autobroadcast.hpp | 15 +------ .../include/ngraph/builder/make_constant.hpp | 0 .../include/ngraph/builder/matmul_factory.hpp | 6 +-- .../include/ngraph/builder/norm.hpp | 4 -- .../include/ngraph/builder/reduce_ops.hpp | 4 -- .../include/ngraph/builder/reshape.hpp | 7 --- .../include/ngraph/builder/split.hpp | 3 -- .../src/builder/autobroadcast.cpp | 4 +- .../src/builder/matmul_factory.cpp | 8 ++-- .../core/{ => builder}/src/builder/norm.cpp | 0 .../{ => builder}/src/builder/reduce_ops.cpp | 4 +- .../{ => builder}/src/builder/reshape.cpp | 2 +- .../core/{ => builder}/src/builder/split.cpp | 2 +- ngraph/core/include/ngraph/ngraph.hpp | 3 -- ngraph/frontend/onnx_import/CMakeLists.txt | 2 +- ngraph/test/CMakeLists.txt | 8 ++-- .../backend/builder_reduce_ops_opset1.in.cpp | 2 + ngraph/test/backend/reshape.in.cpp | 1 + ngraph/test/builder_autobroadcast.cpp | 1 + ngraph/test/runtime/CMakeLists.txt | 1 + 26 files changed, 72 insertions(+), 61 deletions(-) create mode 100644 ngraph/core/builder/CMakeLists.txt rename ngraph/core/{ => builder}/include/ngraph/builder/autobroadcast.hpp (97%) rename ngraph/core/{ => builder}/include/ngraph/builder/make_constant.hpp (100%) rename ngraph/core/{ => builder}/include/ngraph/builder/matmul_factory.hpp (97%) rename ngraph/core/{ => builder}/include/ngraph/builder/norm.hpp (98%) rename ngraph/core/{ => builder}/include/ngraph/builder/reduce_ops.hpp (98%) rename ngraph/core/{ => builder}/include/ngraph/builder/reshape.hpp (96%) rename ngraph/core/{ => builder}/include/ngraph/builder/split.hpp (98%) rename ngraph/core/{ => builder}/src/builder/autobroadcast.cpp (99%) rename ngraph/core/{ => builder}/src/builder/matmul_factory.cpp (98%) rename ngraph/core/{ => builder}/src/builder/norm.cpp (100%) rename ngraph/core/{ => builder}/src/builder/reduce_ops.cpp (98%) rename ngraph/core/{ => builder}/src/builder/reshape.cpp (99%) rename ngraph/core/{ => builder}/src/builder/split.cpp (99%) diff --git a/inference-engine/src/transformations/CMakeLists.txt b/inference-engine/src/transformations/CMakeLists.txt index 588bdefd8d8..4b83b9d4bd6 100644 --- a/inference-engine/src/transformations/CMakeLists.txt +++ b/inference-engine/src/transformations/CMakeLists.txt @@ -24,7 +24,7 @@ source_group("include" FILES ${PUBLIC_HEADERS}) add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${PUBLIC_HEADERS}) target_link_libraries(${TARGET_NAME} PUBLIC ${NGRAPH_LIBRARIES} - PRIVATE openvino::itt) + PRIVATE openvino::itt ngraph::builder) target_include_directories(${TARGET_NAME} PUBLIC ${PUBLIC_HEADERS_DIR}) diff --git a/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/fc_bias_fusion.hpp b/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/fc_bias_fusion.hpp index 36132cb0537..807baa98c20 100644 --- a/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/fc_bias_fusion.hpp +++ b/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/fc_bias_fusion.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/reshape_fc_fusion.hpp b/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/reshape_fc_fusion.hpp index 58842e0cb69..b81184109af 100644 --- a/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/reshape_fc_fusion.hpp +++ b/inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/reshape_fc_fusion.hpp @@ -9,7 +9,6 @@ #include #include -#include #include #include #include diff --git a/inference-engine/src/transformations/src/ngraph_ops/fully_connected.cpp b/inference-engine/src/transformations/src/ngraph_ops/fully_connected.cpp index 40fdeab9522..54272985104 100644 --- a/inference-engine/src/transformations/src/ngraph_ops/fully_connected.cpp +++ b/inference-engine/src/transformations/src/ngraph_ops/fully_connected.cpp @@ -7,10 +7,6 @@ #include #include -#include "ngraph/builder/matmul_factory.hpp" -#include "ngraph/builder/reshape.hpp" -#include "ngraph/op/reshape.hpp" - using namespace std; using namespace ngraph; diff --git a/ngraph/core/CMakeLists.txt b/ngraph/core/CMakeLists.txt index 665d66af59a..eba464813dd 100644 --- a/ngraph/core/CMakeLists.txt +++ b/ngraph/core/CMakeLists.txt @@ -22,6 +22,7 @@ file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) set(NGRAPH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/ngraph CACHE INTERNAL "") +add_subdirectory(builder) add_subdirectory(reference) # Create named folders for the sources within the .vcproj @@ -40,7 +41,7 @@ set_target_properties(ngraph PROPERTIES C_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) -target_link_libraries(ngraph PRIVATE openvino::itt ngraph::reference) +target_link_libraries(ngraph PRIVATE openvino::itt ngraph::builder ngraph::reference) find_package(Graphviz QUIET) if (GRAPHVIZ_FOUND) @@ -82,7 +83,6 @@ endif() # Defines macro in C++ to load backend plugin target_include_directories(ngraph PUBLIC $ $) target_include_directories(ngraph PRIVATE ${NGRAPH_INCLUDE_DIR} - ${NGRAPH_INCLUDE_DIR}/builder ${NGRAPH_INCLUDE_DIR}/op ${NGRAPH_INCLUDE_DIR}/op/util ${NGRAPH_INCLUDE_DIR}/pass diff --git a/ngraph/core/builder/CMakeLists.txt b/ngraph/core/builder/CMakeLists.txt new file mode 100644 index 00000000000..5ceb7fbfed1 --- /dev/null +++ b/ngraph/core/builder/CMakeLists.txt @@ -0,0 +1,44 @@ +# ****************************************************************************** +# Copyright 2017-2020 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ****************************************************************************** + +set(TARGET_NAME "ngraph_builders") + +file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) +file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) + +set(BUILDER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/ CACHE INTERNAL "") + +# Create named folders for the sources within the .vcproj +# Empty name lists them directly under the .vcproj + +source_group("src" FILES ${LIBRARY_SRC}) +source_group("include" FILES ${PUBLIC_HEADERS}) + +# Create shared library +add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS}) + +# Defines macro in C++ to load backend plugin +target_include_directories(${TARGET_NAME} PUBLIC ${BUILDER_INCLUDE_DIR}) +target_include_directories(${TARGET_NAME} PRIVATE ${NGRAPH_INCLUDE_PATH} + ${BUILDER_INCLUDE_DIR}/ngraph/ + ${BUILDER_INCLUDE_DIR}/ngraph/builder) + +#Add an alias so that library can be used inside the build tree, e.g. when testing +add_library(ngraph::builder ALIAS ${TARGET_NAME}) + +# developer package + +openvino_developer_export_targets(ngraph::builder) diff --git a/ngraph/core/include/ngraph/builder/autobroadcast.hpp b/ngraph/core/builder/include/ngraph/builder/autobroadcast.hpp similarity index 97% rename from ngraph/core/include/ngraph/builder/autobroadcast.hpp rename to ngraph/core/builder/include/ngraph/builder/autobroadcast.hpp index cdec6a5206c..7480f601181 100644 --- a/ngraph/core/include/ngraph/builder/autobroadcast.hpp +++ b/ngraph/core/builder/include/ngraph/builder/autobroadcast.hpp @@ -27,7 +27,7 @@ namespace ngraph { namespace builder { - class NGRAPH_API numpy_autobroadcast_incompatible_shapes : public ngraph::ngraph_error + class numpy_autobroadcast_incompatible_shapes : public ngraph::ngraph_error { public: numpy_autobroadcast_incompatible_shapes(const ngraph::Shape& shape1, @@ -55,7 +55,6 @@ namespace ngraph /// \return Vector of broadcasted values. /// NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API OutputVector numpy_broadcast_outputs(const OutputVector& values); /// @@ -68,7 +67,6 @@ namespace ngraph /// \return Node producing values with requested shape. /// NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API std::shared_ptr numpy_broadcast(const Output& value, const Shape& shape); /// \brief Wrap two graph values, if necessary, to obtain values with identical shapes, @@ -100,7 +98,6 @@ namespace ngraph /// /// \exception ngraph::builder::numpy_autobroadcast_incompatible_shapes NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API std::pair, std::shared_ptr> numpy_broadcast(const std::pair, Output>& args); @@ -177,7 +174,6 @@ namespace ngraph /// \return The vector containing both outputs broadcasted. /// NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API OutputVector numpy_broadcast_for_matmul_operation(const Output& left, const Output& right); @@ -189,7 +185,6 @@ namespace ngraph /// /// \return pdpd-style broadcasted list of nodes. NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API OutputVector pdpd_broadcast(const OutputVector& inputs, int64_t axis); /// \brief Generate a list of broadcast axes. @@ -207,7 +202,6 @@ namespace ngraph /// /// \return The indices of added axes. NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API AxisSet calculate_broadcast_axes(const Shape& output_shape, const Shape& input_shape, std::size_t start_match_axis); @@ -229,7 +223,6 @@ namespace ngraph /// padded input shapes ready to be broadcasted as the second object /// NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API std::pair> get_numpy_broadcast_shapes(const std::vector& input_shapes); @@ -292,7 +285,6 @@ namespace ngraph /// /// \return The Output object connected to node producing broadcasted right node. /// - NGRAPH_API Output legacy_broadcast_for_binary_operation(const Output& left, const Output& right, size_t start_match_axis); @@ -305,7 +297,6 @@ namespace ngraph /// /// \return The vector with axes indexes mapping . /// - NGRAPH_API std::vector get_axes_mapping(const Shape& output_shape, const AxisSet& broadcast_axes); @@ -319,7 +310,6 @@ namespace ngraph /// /// \return Returns the Output object pointing to node with the axes mapping. /// - NGRAPH_API Output get_axes_mapping_output(const Shape& output_shape, const Shape& input_shape, std::size_t start_match_axis); @@ -332,16 +322,13 @@ namespace ngraph /// /// \return The Output object with Node returning axes mapping. /// - NGRAPH_API Output get_axes_mapping_output(const Shape& output_shape, const AxisSet& broadcast_axes); - NGRAPH_API Output make_broadcast(const Output& node, const Shape& target_shape, const AxisSet& broadcast_axes); - NGRAPH_API Output make_broadcast(const Output& node, const Shape& target_shape, std::size_t start_match_axis); diff --git a/ngraph/core/include/ngraph/builder/make_constant.hpp b/ngraph/core/builder/include/ngraph/builder/make_constant.hpp similarity index 100% rename from ngraph/core/include/ngraph/builder/make_constant.hpp rename to ngraph/core/builder/include/ngraph/builder/make_constant.hpp diff --git a/ngraph/core/include/ngraph/builder/matmul_factory.hpp b/ngraph/core/builder/include/ngraph/builder/matmul_factory.hpp similarity index 97% rename from ngraph/core/include/ngraph/builder/matmul_factory.hpp rename to ngraph/core/builder/include/ngraph/builder/matmul_factory.hpp index 4e78082efff..8abfd7f9aa0 100644 --- a/ngraph/core/include/ngraph/builder/matmul_factory.hpp +++ b/ngraph/core/builder/include/ngraph/builder/matmul_factory.hpp @@ -30,7 +30,7 @@ namespace ngraph /// floating-point data. /// Subclasses: `QLinearMatmulFactory` and `MatmulIntegerFactory` implement quantized /// versions. - class NGRAPH_DEPRECATED("This builder was deprecated.") NGRAPH_API MatmulFactory + class NGRAPH_DEPRECATED("This builder was deprecated.") MatmulFactory { public: explicit MatmulFactory(const OutputVector& inputs) @@ -60,7 +60,7 @@ namespace ngraph /// \brief Factory class which generates an nGraph sub-graph based on an ONNX QLinearMatMul /// operation. - class NGRAPH_DEPRECATED("This builder was deprecated.") NGRAPH_API QLinearMatmulFactory + class NGRAPH_DEPRECATED("This builder was deprecated.") QLinearMatmulFactory : public MatmulFactory { public: @@ -76,7 +76,7 @@ namespace ngraph /// \brief Factory class which generates an nGraph sub-graph based on an ONNX MatMulInteger /// operation. - class NGRAPH_DEPRECATED("This builder was deprecated.") NGRAPH_API MatmulIntegerFactory + class NGRAPH_DEPRECATED("This builder was deprecated.") MatmulIntegerFactory : public MatmulFactory { public: diff --git a/ngraph/core/include/ngraph/builder/norm.hpp b/ngraph/core/builder/include/ngraph/builder/norm.hpp similarity index 98% rename from ngraph/core/include/ngraph/builder/norm.hpp rename to ngraph/core/builder/include/ngraph/builder/norm.hpp index 4fb5ae3e6a7..ec3a0f5f231 100644 --- a/ngraph/core/include/ngraph/builder/norm.hpp +++ b/ngraph/core/builder/include/ngraph/builder/norm.hpp @@ -46,7 +46,6 @@ namespace ngraph /// /// \return L-0 norm of value. The output sub-graph is composed of v1 ops. /// - NGRAPH_API std::shared_ptr l0_norm(const Output& value, const Output& reduction_axes); @@ -60,7 +59,6 @@ namespace ngraph /// /// \return L-1 norm of value. The output sub-graph is composed of v1 ops. /// - NGRAPH_API std::shared_ptr l1_norm(const Output& value, const Output& reduction_axes, float bias = 0.f); @@ -78,7 +76,6 @@ namespace ngraph /// /// \return L-2 norm of value. The output sub-graph is composed of v1 ops. /// - NGRAPH_API std::shared_ptr l2_norm(const Output& value, const Output& reduction_axes, float bias = 0.f, @@ -94,7 +91,6 @@ namespace ngraph /// /// \return L-p norm of value. The output sub-graph is composed of v1 ops. /// - NGRAPH_API std::shared_ptr lp_norm(const Output& value, const Output& reduction_axes, std::size_t p_norm = 2, diff --git a/ngraph/core/include/ngraph/builder/reduce_ops.hpp b/ngraph/core/builder/include/ngraph/builder/reduce_ops.hpp similarity index 98% rename from ngraph/core/include/ngraph/builder/reduce_ops.hpp rename to ngraph/core/builder/include/ngraph/builder/reduce_ops.hpp index ded40b018cf..99c85d001a1 100644 --- a/ngraph/core/include/ngraph/builder/reduce_ops.hpp +++ b/ngraph/core/builder/include/ngraph/builder/reduce_ops.hpp @@ -48,12 +48,10 @@ namespace ngraph /// | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | /// | \f$E[\textit{delete}(A,d_1,\dots,d_n)]\f$ | The tensor \f$T\f$, where \f$T\f$ is the input tensor with the `reduction_axes` \f$A\f$ eliminated by reduction. | // clang-format on - NGRAPH_API std::shared_ptr mean(const Output& node, const AxisSet& reduction_axes, bool keep_dims = false); - NGRAPH_API std::shared_ptr mean(const Output& node, const Output& reduction_axes, bool keep_dims = false); @@ -85,12 +83,10 @@ namespace ngraph /// | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | /// | \f$E[\textit{delete}(A,d_1,\dots,d_n)]\f$ | The tensor \f$T\f$, where \f$T\f$ is the input tensor with the `reduction_axes` \f$A\f$ eliminated by reduction. | // clang-format on - NGRAPH_API std::shared_ptr variance(const Output& value, const AxisSet& reduction_axes, const bool bessel_correction = false); - NGRAPH_API std::shared_ptr variance(const Output& value, const Output& reduction_axes, bool keep_dims = false, diff --git a/ngraph/core/include/ngraph/builder/reshape.hpp b/ngraph/core/builder/include/ngraph/builder/reshape.hpp similarity index 96% rename from ngraph/core/include/ngraph/builder/reshape.hpp rename to ngraph/core/builder/include/ngraph/builder/reshape.hpp index 5af06e7e5d2..58330fe5590 100644 --- a/ngraph/core/include/ngraph/builder/reshape.hpp +++ b/ngraph/core/builder/include/ngraph/builder/reshape.hpp @@ -35,7 +35,6 @@ namespace ngraph /// \param[in] shape The new shape. /// /// \return Reshape:v1 op. - NGRAPH_API std::shared_ptr reshape(const Output& value, const Shape& shape); /// \brief Permute axes according to specified axes_order parameter. @@ -44,7 +43,6 @@ namespace ngraph /// \param axes_order The permutation of axes. /// /// \return Transpose:v1 op. - NGRAPH_API std::shared_ptr reorder_axes(const Output& value, std::vector axes_order = {}); @@ -53,7 +51,6 @@ namespace ngraph /// \param Value to transpose. /// /// \return Transpose:v1 op. - NGRAPH_API std::shared_ptr transpose(const Output& value); /// \brief Flatten a value into a 2D matrix, with a static dividing axis. @@ -63,7 +60,6 @@ namespace ngraph /// /// \return The new value will be a 2D matrix representing the flattened input /// node. - NGRAPH_API std::shared_ptr flatten(const Output& value, int axis); /// \brief Expands node tensor shape with empty axis at @@ -74,7 +70,6 @@ namespace ngraph /// new axis is placed. /// /// \return Reshape:v1 op. - NGRAPH_API std::shared_ptr expand_dims(const Output& value, std::size_t axis = 0); /// \brief Remove empty axes from input tensor. @@ -83,7 +78,6 @@ namespace ngraph /// \param[in] axes The vector defining indexes of axes to be removed. /// /// \return Reshape:v1 op. - NGRAPH_API std::shared_ptr squeeze(const Output& value, std::vector axes = {0}); @@ -97,7 +91,6 @@ namespace ngraph /// /// \return The node with collapsed specified axes. /// - NGRAPH_API std::shared_ptr collapse(const Output& value, const std::size_t start_axis, const std::size_t end_axis); diff --git a/ngraph/core/include/ngraph/builder/split.hpp b/ngraph/core/builder/include/ngraph/builder/split.hpp similarity index 98% rename from ngraph/core/include/ngraph/builder/split.hpp rename to ngraph/core/builder/include/ngraph/builder/split.hpp index b3aecadf7a6..bca0627d90f 100644 --- a/ngraph/core/include/ngraph/builder/split.hpp +++ b/ngraph/core/builder/include/ngraph/builder/split.hpp @@ -51,7 +51,6 @@ namespace ngraph /// \return The vector containing multiple outputs we split input node into. /// NGRAPH_DEPRECATED("This builder was deprecated.") - NGRAPH_API OutputVector split(const Output& value, size_t split_parts, int axis = 0); namespace opset1 @@ -69,7 +68,6 @@ namespace ngraph /// \return The vector containing multiple outputs we split input node into. /// The vector is output of Split:v1 op /// - NGRAPH_API OutputVector split(const Output& value, const std::vector& split_lengths, int64_t axis = 0); @@ -90,7 +88,6 @@ namespace ngraph /// \return The vector containing multiple nodes we split input node into. /// The vector is output of VariadicSplit:v1 op /// - NGRAPH_API OutputVector split(const Output& value, size_t num_splits, int64_t axis = 0); } } // namespace builder diff --git a/ngraph/core/src/builder/autobroadcast.cpp b/ngraph/core/builder/src/builder/autobroadcast.cpp similarity index 99% rename from ngraph/core/src/builder/autobroadcast.cpp rename to ngraph/core/builder/src/builder/autobroadcast.cpp index a5c1b03a527..5003097b2d3 100644 --- a/ngraph/core/src/builder/autobroadcast.cpp +++ b/ngraph/core/builder/src/builder/autobroadcast.cpp @@ -14,14 +14,14 @@ // limitations under the License. //***************************************************************************** -#include "ngraph/builder/autobroadcast.hpp" +#include "builder/autobroadcast.hpp" #include #include #include +#include "builder/reshape.hpp" #include "ngraph/axis_vector.hpp" -#include "ngraph/builder/reshape.hpp" #include "ngraph/check.hpp" #include "ngraph/op/broadcast.hpp" #include "ngraph/op/constant.hpp" diff --git a/ngraph/core/src/builder/matmul_factory.cpp b/ngraph/core/builder/src/builder/matmul_factory.cpp similarity index 98% rename from ngraph/core/src/builder/matmul_factory.cpp rename to ngraph/core/builder/src/builder/matmul_factory.cpp index a34f34c7c33..753287cccda 100644 --- a/ngraph/core/src/builder/matmul_factory.cpp +++ b/ngraph/core/builder/src/builder/matmul_factory.cpp @@ -19,10 +19,10 @@ #include #include -#include "ngraph/builder/autobroadcast.hpp" -#include "ngraph/builder/make_constant.hpp" -#include "ngraph/builder/matmul_factory.hpp" -#include "ngraph/builder/reshape.hpp" +#include "builder/autobroadcast.hpp" +#include "builder/make_constant.hpp" +#include "builder/matmul_factory.hpp" +#include "builder/reshape.hpp" #include "ngraph/op/concat.hpp" #include "ngraph/op/dot.hpp" #include "ngraph/op/quantized_dot.hpp" diff --git a/ngraph/core/src/builder/norm.cpp b/ngraph/core/builder/src/builder/norm.cpp similarity index 100% rename from ngraph/core/src/builder/norm.cpp rename to ngraph/core/builder/src/builder/norm.cpp diff --git a/ngraph/core/src/builder/reduce_ops.cpp b/ngraph/core/builder/src/builder/reduce_ops.cpp similarity index 98% rename from ngraph/core/src/builder/reduce_ops.cpp rename to ngraph/core/builder/src/builder/reduce_ops.cpp index 9c9257650c8..068b40a675a 100644 --- a/ngraph/core/src/builder/reduce_ops.cpp +++ b/ngraph/core/builder/src/builder/reduce_ops.cpp @@ -16,9 +16,9 @@ #include +#include "builder/autobroadcast.hpp" +#include "builder/reduce_ops.hpp" #include "ngraph/axis_set.hpp" -#include "ngraph/builder/autobroadcast.hpp" -#include "ngraph/builder/reduce_ops.hpp" #include "ngraph/op/constant.hpp" #include "ngraph/op/divide.hpp" #include "ngraph/op/multiply.hpp" diff --git a/ngraph/core/src/builder/reshape.cpp b/ngraph/core/builder/src/builder/reshape.cpp similarity index 99% rename from ngraph/core/src/builder/reshape.cpp rename to ngraph/core/builder/src/builder/reshape.cpp index 97837a51d25..e7bab2360db 100644 --- a/ngraph/core/src/builder/reshape.cpp +++ b/ngraph/core/builder/src/builder/reshape.cpp @@ -19,8 +19,8 @@ #include #include +#include "builder/reshape.hpp" #include "ngraph/axis_vector.hpp" -#include "ngraph/builder/reshape.hpp" #include "ngraph/op/concat.hpp" #include "ngraph/op/constant.hpp" #include "ngraph/op/product.hpp" diff --git a/ngraph/core/src/builder/split.cpp b/ngraph/core/builder/src/builder/split.cpp similarity index 99% rename from ngraph/core/src/builder/split.cpp rename to ngraph/core/builder/src/builder/split.cpp index 5d5c0c86a80..812b3e69ceb 100644 --- a/ngraph/core/src/builder/split.cpp +++ b/ngraph/core/builder/src/builder/split.cpp @@ -14,7 +14,7 @@ // limitations under the License. //***************************************************************************** -#include "ngraph/builder/split.hpp" +#include "builder/split.hpp" #include "ngraph/op/slice.hpp" #include "ngraph/opsets/opset1.hpp" diff --git a/ngraph/core/include/ngraph/ngraph.hpp b/ngraph/core/include/ngraph/ngraph.hpp index 82972d1d2ea..e4e9e73cac2 100644 --- a/ngraph/core/include/ngraph/ngraph.hpp +++ b/ngraph/core/include/ngraph/ngraph.hpp @@ -67,9 +67,6 @@ namespace ngraph #include "ngraph/attribute_adapter.hpp" #include "ngraph/attribute_visitor.hpp" -#include "ngraph/builder/autobroadcast.hpp" -#include "ngraph/builder/reduce_ops.hpp" -#include "ngraph/builder/reshape.hpp" #include "ngraph/descriptor/input.hpp" #include "ngraph/descriptor/output.hpp" #include "ngraph/descriptor/tensor.hpp" diff --git a/ngraph/frontend/onnx_import/CMakeLists.txt b/ngraph/frontend/onnx_import/CMakeLists.txt index e64c92d1288..a7860bccdf9 100644 --- a/ngraph/frontend/onnx_import/CMakeLists.txt +++ b/ngraph/frontend/onnx_import/CMakeLists.txt @@ -42,7 +42,7 @@ source_group("include" FILES ${PUBLIC_HEADERS}) # Create shared library add_library(onnx_importer SHARED ${LIBRARY_SRC} ${PUBLIC_HEADERS}) -target_link_libraries(onnx_importer PRIVATE onnx onnx_proto ${Protobuf_LIBRARIES}) +target_link_libraries(onnx_importer PRIVATE onnx onnx_proto ${Protobuf_LIBRARIES} ngraph::builder) target_link_libraries(onnx_importer PUBLIC ngraph) set_target_properties(onnx_importer PROPERTIES diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index b0d57e69a54..dd9c3514f47 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -392,9 +392,11 @@ if(NGRAPH_ADDRESS_SANITIZER) add_compile_options(-g -fsanitize=address -fno-omit-frame-pointer) endif() -target_link_libraries(unit-test PRIVATE ngraph_test_util) -target_link_libraries(unit-test PRIVATE ngraph) -target_link_libraries(unit-test PRIVATE ngraph_backend libgtest) +target_link_libraries(unit-test PRIVATE ngraph_test_util + ngraph + ngraph::builder + ngraph_backend + libgtest) # Protobuf-lite does not support parsing files from prototxt format # Since most of the onnx models are stored in this format it have to be disabled diff --git a/ngraph/test/backend/builder_reduce_ops_opset1.in.cpp b/ngraph/test/backend/builder_reduce_ops_opset1.in.cpp index 8dbfef14c12..1a322bb09bf 100644 --- a/ngraph/test/backend/builder_reduce_ops_opset1.in.cpp +++ b/ngraph/test/backend/builder_reduce_ops_opset1.in.cpp @@ -16,6 +16,8 @@ #include +#include "ngraph/builder/reduce_ops.hpp" +#include "ngraph/builder/reshape.hpp" #include "ngraph/ngraph.hpp" #include "util/engine/test_engines.hpp" #include "util/test_case.hpp" diff --git a/ngraph/test/backend/reshape.in.cpp b/ngraph/test/backend/reshape.in.cpp index e3bb4a1deb2..3e703d2cdda 100644 --- a/ngraph/test/backend/reshape.in.cpp +++ b/ngraph/test/backend/reshape.in.cpp @@ -23,6 +23,7 @@ #include #include "gtest/gtest.h" +#include "ngraph/builder/reshape.hpp" #include "ngraph/ngraph.hpp" #include "ngraph/runtime/tensor.hpp" #include "runtime/backend.hpp" diff --git a/ngraph/test/builder_autobroadcast.cpp b/ngraph/test/builder_autobroadcast.cpp index 8c8c6e1aa1a..6a4ce49882a 100644 --- a/ngraph/test/builder_autobroadcast.cpp +++ b/ngraph/test/builder_autobroadcast.cpp @@ -16,6 +16,7 @@ #include "gtest/gtest.h" +#include "ngraph/builder/autobroadcast.hpp" #include "ngraph/ngraph.hpp" NGRAPH_SUPPRESS_DEPRECATED_START diff --git a/ngraph/test/runtime/CMakeLists.txt b/ngraph/test/runtime/CMakeLists.txt index 7ea6a198f5a..e37aba8b7bd 100644 --- a/ngraph/test/runtime/CMakeLists.txt +++ b/ngraph/test/runtime/CMakeLists.txt @@ -58,6 +58,7 @@ target_compile_definitions(ngraph_backend SHARED_LIB_SUFFIX="${IE_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) target_link_libraries(ngraph_backend PUBLIC ngraph + ngraph::builder ngraph::reference) if (NOT WIN32) target_link_libraries(ngraph_backend PRIVATE dl)