-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
openvino: Add threading option supporting tbb and omp #23068
Open
Greendogo
wants to merge
2
commits into
conan-io:master
Choose a base branch
from
Greendogo:openvino-threading-option
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -45,7 +45,9 @@ class OpenvinoConan(ConanFile): | |||||||
"enable_tf_frontend": [True, False], | ||||||||
"enable_tf_lite_frontend": [True, False], | ||||||||
"enable_paddle_frontend": [True, False], | ||||||||
"enable_pytorch_frontend": [True, False] | ||||||||
"enable_pytorch_frontend": [True, False], | ||||||||
# Threading | ||||||||
"threading": ["tbb", "omp"] | ||||||||
} | ||||||||
default_options = { | ||||||||
"shared": False, | ||||||||
|
@@ -63,7 +65,9 @@ class OpenvinoConan(ConanFile): | |||||||
"enable_tf_frontend": True, | ||||||||
"enable_tf_lite_frontend": True, | ||||||||
"enable_paddle_frontend": True, | ||||||||
"enable_pytorch_frontend": True | ||||||||
"enable_pytorch_frontend": True, | ||||||||
# Threading | ||||||||
"threading": "tbb" | ||||||||
} | ||||||||
|
||||||||
@property | ||||||||
|
@@ -166,7 +170,8 @@ def build_requirements(self): | |||||||
self.tool_requires("cmake/[>=3.18 <4]") | ||||||||
|
||||||||
def requirements(self): | ||||||||
self.requires("onetbb/2021.10.0") | ||||||||
if self.options.threading == "tbb": | ||||||||
self.requires("onetbb/2021.10.0") | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
TBB includes are being used in a public header, if I understand it correctly. |
||||||||
self.requires("pugixml/1.14") | ||||||||
if self._target_x86_64: | ||||||||
self.requires("xbyak/6.73") | ||||||||
|
@@ -218,8 +223,14 @@ def generate(self): | |||||||
toolchain.cache_variables["ENABLE_OV_ONNX_FRONTEND"] = self.options.enable_onnx_frontend | ||||||||
toolchain.cache_variables["ENABLE_OV_PYTORCH_FRONTEND"] = self.options.enable_pytorch_frontend | ||||||||
# Dependencies | ||||||||
toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = True | ||||||||
toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False | ||||||||
if self.options.threading == "tbb": | ||||||||
toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = True | ||||||||
toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False | ||||||||
toolchain.cache_variables["THREADING"] = "TBB" | ||||||||
else: | ||||||||
toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = False | ||||||||
toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False | ||||||||
toolchain.cache_variables["THREADING"] = "OMP" | ||||||||
toolchain.cache_variables["ENABLE_SYSTEM_PUGIXML"] = True | ||||||||
if self._protobuf_required: | ||||||||
toolchain.cache_variables["ENABLE_SYSTEM_PROTOBUF"] = True | ||||||||
|
@@ -298,7 +309,10 @@ def package_info(self): | |||||||
|
||||||||
openvino_runtime = self.cpp_info.components["Runtime"] | ||||||||
openvino_runtime.set_property("cmake_target_name", "openvino::runtime") | ||||||||
openvino_runtime.requires = ["onetbb::libtbb", "pugixml::pugixml"] | ||||||||
if self.options.threading == "tbb": | ||||||||
openvino_runtime.requires = ["onetbb::libtbb", "pugixml::pugixml"] | ||||||||
else: | ||||||||
openvino_runtime.requires = ["pugixml::pugixml"] | ||||||||
Greendogo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
openvino_runtime.libs = ["openvino"] | ||||||||
if self._preprocessing_available: | ||||||||
openvino_runtime.requires.append("ade::ade") | ||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seq
is also available to disable the threadingthreading
since 2024.4 ? because before that version OpenMP support was not enough tested / supported.