Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved CC macros to public API #5929

Merged

Conversation

ilyachur
Copy link
Contributor

Details:

  • Moved CC macros for transformations to public API (to reuse their in plugin transformations)

@ilyachur ilyachur added the category: Core OpenVINO Core (aka ngraph) label May 31, 2021
@ilyachur ilyachur requested a review from nkogteva May 31, 2021 13:48
@ilyachur ilyachur requested a review from GlebKazantaev as a code owner May 31, 2021 13:48
@ilyachur ilyachur requested a review from a team May 31, 2021 13:48
@@ -11,6 +11,7 @@

#include <openvino/cc/selective_build.h>
#include <openvino/itt.hpp>
#include <ngraph/pass/itt.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to replace code in snippets then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't have CC macros in snippets. I added these macros to template plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really?

#if defined(SELECTIVE_BUILD_ANALYZER)
#define RUN_ON_FUNCTION_SCOPE(region) OV_SCOPE(ngraph_pass, OV_PP_CAT(region, _run_on_function))
#define MATCHER_SCOPE(region) \
const std::string matcher_name(OV_PP_TOSTRING(region))
#define INTERNAL_OP_SCOPE(region) OV_SCOPE(internal_op, region)
#elif defined(SELECTIVE_BUILD)
#define MATCHER_SCOPE_(scope, region) \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(scope, _, region)) == 0) \
throw ngraph::ngraph_error(std::string(OV_PP_TOSTRING(OV_PP_CAT3(scope, _, region))) + \
" is disabled!")
#define MATCHER_SCOPE(region) \
const std::string matcher_name(OV_PP_TOSTRING(region)); \
if (OV_CC_SCOPE_IS_ENABLED(OV_PP_CAT3(ngraph_pass, _, region)) == 0) \
return
#define INTERNAL_OP_SCOPE(region) MATCHER_SCOPE_(internal_op, region)
#define RUN_ON_FUNCTION_SCOPE(region) MATCHER_SCOPE_(ngraph_pass, OV_PP_CAT(region, _run_on_function))
#else
#define MATCHER_SCOPE(region) \
const std::string matcher_name(OV_PP_TOSTRING(region))
#define INTERNAL_OP_SCOPE(region)
#define RUN_ON_FUNCTION_SCOPE(region)
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@ilyachur ilyachur requested a review from a team as a code owner May 31, 2021 15:29
#pragma once

#include <openvino/cc/selective_build.h>
#include <openvino/itt.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these headers are NOT a part of release package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah right. I will think how to enable this file only for open source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we need to move all this stuff to openvino/itt

@ilyachur ilyachur requested review from a team May 31, 2021 19:26
@ilyachur ilyachur force-pushed the moved_pass_itt_macro_to_ngraph branch from e1d5d53 to 8805c47 Compare May 31, 2021 19:59
@ilya-lavrenov ilya-lavrenov merged commit e803d1a into openvinotoolkit:master Jun 1, 2021
@ilya-lavrenov ilya-lavrenov deleted the moved_pass_itt_macro_to_ngraph branch June 1, 2021 07:05
yekruglov pushed a commit to yekruglov/openvino that referenced this pull request Jun 7, 2021
* Moved CC macros for transformations to public API (to reuse their in plugin transformations)

* Added CC to template plugin

* Moved itt.h from nGraph to openvino/cc

* Fixed build
rnugmanx pushed a commit to rnugmanx/openvino that referenced this pull request Aug 26, 2021
* Moved CC macros for transformations to public API (to reuse their in plugin transformations)

* Added CC to template plugin

* Moved itt.h from nGraph to openvino/cc

* Fixed build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants