[Remove APIs] Fix review comments

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
This commit is contained in:
Zhai, Xuejun 2023-03-06 12:08:58 +08:00
parent 51c024e06b
commit d14a92d174
10 changed files with 12 additions and 28 deletions

View File

@ -17,7 +17,7 @@ namespace ngraph {
namespace pass {
namespace device {
class ConvertOpSet1ToDeviceSpecific: public ngraph::pass::FunctionPass {
class ConvertOpSet1ToDeviceSpecific: public ov::pass::ModelPass {
public:
bool run_on_model(const std::shared_ptr<ngraph::Function>& f) override {
return true;

View File

@ -24,6 +24,11 @@ OV_CC_DOMAINS(ov_pass);
# define ADD_MATCHER(obj, region, ...) obj->add_matcher<region>(__VA_ARGS__);
# define REGISTER_PASS(obj, region, ...) obj.register_pass<region>(__VA_ARGS__);
# define REGISTER_DISABLED_PASS(obj, region, ...) obj.register_pass<region, false>(__VA_ARGS__);
# define OV_PASS_CALLBACK(matcher) \
openvino::itt::handle_t m_callback_handle; \
m_callback_handle = openvino::itt::handle(matcher->get_name()); \
OV_ITT_SCOPED_TASK(SIMPLE_ov_pass, m_callback_handle)
#elif defined(SELECTIVE_BUILD)
# define MATCHER_SCOPE_(scope, region) \
@ -70,6 +75,7 @@ OV_CC_DOMAINS(ov_pass);
# define REGISTER_DISABLED_PASS(obj, region, ...) \
OV_PP_CAT(REGISTER_PASS_WITH_FALSE_, OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(ov_pass, _, region))) \
(obj, region, __VA_ARGS__)
# define OV_PASS_CALLBACK(matcher)
#else
# define MATCHER_SCOPE(region) const std::string matcher_name(OV_PP_TOSTRING(region))
@ -79,6 +85,7 @@ OV_CC_DOMAINS(ov_pass);
# define ADD_MATCHER(obj, region, ...) obj->add_matcher<region>(__VA_ARGS__);
# define REGISTER_PASS(obj, region, ...) obj.register_pass<region>(__VA_ARGS__);
# define REGISTER_DISABLED_PASS(obj, region, ...) obj.register_pass<region, false>(__VA_ARGS__);
# define OV_PASS_CALLBACK(matcher)
#endif
#define ADD_MATCHER_FOR_THIS(region, ...) ADD_MATCHER(this, region, __VA_ARGS__)

View File

@ -33,8 +33,7 @@ target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt)
target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>
${CMAKE_CURRENT_SOURCE_DIR}/../..)
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>)
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}_obj)
@ -52,8 +51,7 @@ target_link_libraries(${TARGET_NAME} INTERFACE openvino::runtime)
target_include_directories(${TARGET_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>>
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>
${CMAKE_CURRENT_SOURCE_DIR}/../..)
$<BUILD_INTERFACE:$<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>>)
# LTO

View File

@ -4,7 +4,6 @@
#include <low_precision/layer_transformation.hpp>
#include <low_precision/network_helper.hpp>
#include "core/src/itt.hpp"
#include <algorithm>
#include <cmath>

View File

@ -5,7 +5,6 @@
#include "low_precision/low_precision.hpp"
#include <memory>
#include "core/src/itt.hpp"
#include <ngraph/ngraph.hpp>
#include <ngraph/pass/manager.hpp>
#include <ngraph/pass/constant_folding.hpp>

View File

@ -91,10 +91,7 @@ class OPENVINO_API ModelPass : public PassBase {
public:
OPENVINO_RTTI("ov::pass::ModelPass");
~ModelPass() override;
virtual bool run_on_model(const std::shared_ptr<ov::Model>& m);
private:
bool call_on_model{false};
virtual bool run_on_model(const std::shared_ptr<ov::Model>& m) = 0;
};
} // namespace pass

View File

@ -33,10 +33,6 @@ OV_CC_DOMAINS(ov_opset);
*/
#if defined(SELECTIVE_BUILD_ANALYZER)
# define OV_OP_SCOPE(region) OV_SCOPE(ov_op, region)
# define OV_PASS_CALLBACK(matcher) \
openvino::itt::handle_t m_callback_handle; \
m_callback_handle = openvino::itt::handle(matcher->get_name()); \
OV_ITT_SCOPED_TASK(SIMPLE_ov_pass, m_callback_handle)
# define REGISTER_OP(opset_name, op_name) \
OV_ITT_SCOPED_TASK(SIMPLE_ov_opset, openvino::itt::handle(opset_name + "_" + op_name))
# define INSERT_OP(opset_name, op_name, op_namespace) opset.insert<op_namespace::op_name>()
@ -44,14 +40,12 @@ OV_CC_DOMAINS(ov_opset);
# define OV_OP_SCOPE(region) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(ov_op, _, region)) == 0) \
throw ngraph::ngraph_error(std::string(OV_PP_TOSTRING(OV_PP_CAT3(ov_op, _, region))) + " is disabled!")
# define OV_PASS_CALLBACK(matcher)
# define REGISTER_OP(opset_name, op_name)
# define INSERT_OP(opset_name, op_name, op_namespace) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT4(ov_opset_, opset_name, _, op_name)) == 1) \
opset.insert<op_namespace::op_name>()
#else
# define OV_OP_SCOPE(region) OV_ITT_SCOPED_TASK(ov::itt::domains::ov_op, OV_PP_TOSTRING(region))
# define OV_PASS_CALLBACK(matcher)
# define REGISTER_OP(opset_name, op_name)
# define INSERT_OP(opset_name, op_name, op_namespace) opset.insert<op_namespace::op_name>()
#endif

View File

@ -72,13 +72,6 @@ private:
ov::pass::ModelPass::~ModelPass() = default;
bool ov::pass::ModelPass::run_on_model(const std::shared_ptr<ov::Model>& m) {
RUN_ON_MODEL_SCOPE(ModelPass);
RunLocker locked(call_on_model);
bool sts = run_on_model(m);
return sts;
}
NGRAPH_RTTI_DEFINITION(ngraph::pass::NodePass, "ngraph::pass::NodePass", 0);
ngraph::pass::NodePass::~NodePass() = default;

View File

@ -34,9 +34,7 @@ target_compile_definitions(interpreter_backend
)
target_link_libraries(interpreter_backend PRIVATE ngraph::builder ngraph::reference openvino::util openvino::runtime::dev)
target_include_directories(interpreter_backend PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
${CMAKE_CURRENT_SOURCE_DIR}/../../..
${CMAKE_CURRENT_SOURCE_DIR}/../../../common/conditional_compilation/include)
target_include_directories(interpreter_backend PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
file(GLOB_RECURSE all_backends_src "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
add_clang_format_target(interpreter_backend_clang FOR_SOURCES ${all_backends_src})

View File

@ -6,7 +6,6 @@
#include <numeric>
#include "core/src/itt.hpp"
#include "ngraph/builder/reshape.hpp"
#include "ngraph/op/broadcast.hpp"
#include "ngraph/op/range.hpp"