Move template plugin to plugin folder (#13269)
* Moved template_plugin * Move template extension * Changed cmake configs * Try to fix build * Moved plugin to standalone folder and fixed build * Try to fix doc * Try to fix doc * Update CMakeLists.txt * Moved extensions to src/core
This commit is contained in:
parent
9d02de9cc0
commit
943f77d9ec
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,7 +23,6 @@ doc/
|
|||||||
docs/build_documentation/work_dir/
|
docs/build_documentation/work_dir/
|
||||||
temp/
|
temp/
|
||||||
.repo/
|
.repo/
|
||||||
docs/template_plugin/html/
|
|
||||||
CMakeLists.txt.user
|
CMakeLists.txt.user
|
||||||
docs/IE_PLUGIN_DG/html/
|
docs/IE_PLUGIN_DG/html/
|
||||||
|
|
||||||
|
@ -107,9 +107,9 @@ add_subdirectory(thirdparty)
|
|||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(samples)
|
add_subdirectory(samples)
|
||||||
|
|
||||||
# Enable interpreter backend
|
# Enable interpreter backend for tests
|
||||||
if (ENABLE_TESTS OR ENABLE_TEMPLATE)
|
if (ENABLE_TESTS OR ENABLE_TEMPLATE)
|
||||||
add_subdirectory(docs/template_plugin/backend)
|
add_subdirectory(src/plugins/template/backend)
|
||||||
endif()
|
endif()
|
||||||
include(cmake/extra_modules.cmake)
|
include(cmake/extra_modules.cmake)
|
||||||
add_subdirectory(docs)
|
add_subdirectory(docs)
|
||||||
|
@ -98,10 +98,9 @@ CMakeLists.txt @openvinotoolkit/openvino-ie-maintainers
|
|||||||
|
|
||||||
# Documentation:
|
# Documentation:
|
||||||
/docs/ @openvinotoolkit/openvino-docs-maintainers
|
/docs/ @openvinotoolkit/openvino-docs-maintainers
|
||||||
/docs/template_plugin/ @openvinotoolkit/openvino-ie-template-maintainers
|
|
||||||
/docs/template_extension/ @openvinotoolkit/openvino-ie-template-maintainers
|
|
||||||
*.md @openvinotoolkit/openvino-docs-maintainers
|
*.md @openvinotoolkit/openvino-docs-maintainers
|
||||||
README @openvinotoolkit/openvino-docs-maintainers
|
README @openvinotoolkit/openvino-docs-maintainers
|
||||||
|
/src/plugins/template/ @openvinotoolkit/openvino-ie-template-maintainers
|
||||||
|
|
||||||
# Control 3d party dependencies
|
# Control 3d party dependencies
|
||||||
**/*requirements*.* @openvinotoolkit/openvino-configuration-mgmt
|
**/*requirements*.* @openvinotoolkit/openvino-configuration-mgmt
|
||||||
|
@ -115,7 +115,7 @@ endif()
|
|||||||
|
|
||||||
if(ENABLE_TEMPLATE)
|
if(ENABLE_TEMPLATE)
|
||||||
ov_coverage_extract(INPUT "openvino" OUTPUT "template_plugin"
|
ov_coverage_extract(INPUT "openvino" OUTPUT "template_plugin"
|
||||||
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/docs/template_plugin/*")
|
PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/src/plugins/template/*")
|
||||||
ov_coverage_genhtml(INFO_FILE "template_plugin"
|
ov_coverage_genhtml(INFO_FILE "template_plugin"
|
||||||
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
PREFIX "${OV_COVERAGE_BASE_DIRECTORY}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -35,13 +35,15 @@ function(ov_generate_dev_package_config)
|
|||||||
find_package(OpenCV QUIET)
|
find_package(OpenCV QUIET)
|
||||||
|
|
||||||
foreach(component IN LISTS openvino_export_components)
|
foreach(component IN LISTS openvino_export_components)
|
||||||
string(FIND "${component}" "_legacy" index)
|
# TODO: remove legacy targets from tests
|
||||||
if(index EQUAL -1)
|
# string(FIND "${component}" "_legacy" index)
|
||||||
# export all targets with prefix and use them during extra modules build
|
# if(index EQUAL -1)
|
||||||
export(TARGETS ${${component}} NAMESPACE openvino::
|
|
||||||
APPEND FILE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
|
# export all targets with prefix and use them during extra modules build
|
||||||
list(APPEND all_dev_targets ${${component}})
|
export(TARGETS ${${component}} NAMESPACE openvino::
|
||||||
endif()
|
APPEND FILE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
|
||||||
|
list(APPEND all_dev_targets ${${component}})
|
||||||
|
# endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets})
|
add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets})
|
||||||
|
|
||||||
@ -72,6 +74,8 @@ function(register_extra_modules)
|
|||||||
|
|
||||||
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime")
|
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime")
|
||||||
set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/runtime")
|
set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/runtime")
|
||||||
|
set(OpenVINO_DIR ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
|
||||||
function(generate_fake_dev_package NS)
|
function(generate_fake_dev_package NS)
|
||||||
if(NS STREQUAL "openvino")
|
if(NS STREQUAL "openvino")
|
||||||
@ -107,8 +111,9 @@ function(register_extra_modules)
|
|||||||
|
|
||||||
# add template plugin
|
# add template plugin
|
||||||
if(ENABLE_TEMPLATE)
|
if(ENABLE_TEMPLATE)
|
||||||
list(APPEND extra_modules "${OpenVINO_SOURCE_DIR}/docs/template_plugin")
|
list(APPEND extra_modules "${OpenVINO_SOURCE_DIR}/src/plugins/template")
|
||||||
endif()
|
endif()
|
||||||
|
list(APPEND extra_modules "${OpenVINO_SOURCE_DIR}/src/core/template_extension")
|
||||||
|
|
||||||
# add each extra module
|
# add each extra module
|
||||||
foreach(module_path IN LISTS extra_modules)
|
foreach(module_path IN LISTS extra_modules)
|
||||||
|
@ -44,10 +44,11 @@ find_dependency(OpenVINO
|
|||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
foreach(component @openvino_export_components@)
|
foreach(component @openvino_export_components@)
|
||||||
string(FIND "${component}" "_legacy" index)
|
# TODO: remove legacy targets from some tests
|
||||||
if (index EQUAL -1)
|
# string(FIND "${component}" "_legacy" index)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/ov_${component}_dev_targets.cmake")
|
# if (index EQUAL -1)
|
||||||
endif()
|
include("${CMAKE_CURRENT_LIST_DIR}/ov_${component}_dev_targets.cmake")
|
||||||
|
# endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(ENABLE_SYSTEM_PUGIXML)
|
if(ENABLE_SYSTEM_PUGIXML)
|
||||||
|
@ -17,8 +17,6 @@ if(NOT ENABLE_DOCKER)
|
|||||||
|
|
||||||
add_subdirectory(snippets)
|
add_subdirectory(snippets)
|
||||||
|
|
||||||
add_subdirectory(template_extension)
|
|
||||||
|
|
||||||
set(all_docs_targets
|
set(all_docs_targets
|
||||||
ie_docs_snippets ov_template_func_tests
|
ie_docs_snippets ov_template_func_tests
|
||||||
template_extension openvino_template_extension openvino_template_plugin)
|
template_extension openvino_template_extension openvino_template_plugin)
|
||||||
|
@ -1041,16 +1041,12 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \
|
|||||||
EXAMPLE_PATH = "@OpenVINO_SOURCE_DIR@" \
|
EXAMPLE_PATH = "@OpenVINO_SOURCE_DIR@" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/" \
|
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/" \
|
"@OpenVINO_SOURCE_DIR@/docs/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/" \
|
"@OpenVINO_SOURCE_DIR@/src/plugins/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/old/" \
|
"@OpenVINO_SOURCE_DIR@/src/core/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_extension/new/" \
|
"@OpenVINO_SOURCE_DIR@/src/plugins/template/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/" \
|
"@OpenVINO_SOURCE_DIR@/src/plugins/template/tests/functional/CMakeLists.txt" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/src/" \
|
"@OpenVINO_SOURCE_DIR@/src/plugins/template/tests/functional/transformations/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/include/" \
|
"@OpenVINO_SOURCE_DIR@/src/plugins/template/tests/functional/shared_tests_instances/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/src/CMakeLists.txt" \
|
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/tests/functional/CMakeLists.txt" \
|
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/tests/functional/transformations/" \
|
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/template_plugin/tests/functional/shared_tests_instances/" \
|
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/snippets/" \
|
"@OpenVINO_SOURCE_DIR@/docs/snippets/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/src/tests/functional/plugin/shared/include/" \
|
"@OpenVINO_SOURCE_DIR@/src/tests/functional/plugin/shared/include/" \
|
||||||
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/mo_extensions/ops/" \
|
"@OpenVINO_SOURCE_DIR@/docs/HOWTO/mo_extensions/ops/" \
|
||||||
|
@ -68,7 +68,7 @@ Remaining part of this guide uses Frontend Extension API applicable for new fron
|
|||||||
|
|
||||||
A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.
|
A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.
|
||||||
|
|
||||||
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
||||||
|
|
||||||
To load the extensions to the `ov::Core` object, use the `ov::Core::add_extension` method, this method allows to load library with extensions or extensions from the code.
|
To load the extensions to the `ov::Core` object, use the `ov::Core::add_extension` method, this method allows to load library with extensions or extensions from the code.
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ This CMake script finds the OpenVINO™ using the `find_package` CMake command.
|
|||||||
To build the extension library, run the commands below:
|
To build the extension library, run the commands below:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd docs/template_extension/new
|
$ cd src/core/template_extension/new
|
||||||
$ mkdir build
|
$ mkdir build
|
||||||
$ cd build
|
$ cd build
|
||||||
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
|
$ cmake -DOpenVINO_DIR=<OpenVINO_DIR> ../
|
||||||
|
@ -4,7 +4,7 @@ The goal of this chapter is to explain how to use Frontend extension classes to
|
|||||||
|
|
||||||
This API is applicable for new frontends only, which exist for ONNX and PaddlePaddle. If a different model format is used, follow legacy [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) guide.
|
This API is applicable for new frontends only, which exist for ONNX and PaddlePaddle. If a different model format is used, follow legacy [Model Optimizer Extensions](../MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md) guide.
|
||||||
|
|
||||||
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/docs/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
> **NOTE**: This documentation is written based on the [Template extension](https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new), which demonstrates extension development details based on minimalistic `Identity` operation that is a placeholder for your real custom operation. You can review the complete code, which is fully compliable, to see how it works.
|
||||||
|
|
||||||
## Single Operation Mapping with OpExtension
|
## Single Operation Mapping with OpExtension
|
||||||
|
|
||||||
|
@ -91,12 +91,12 @@ endif()
|
|||||||
|
|
||||||
- `src/CMakeLists.txt` to build a plugin shared library from sources:
|
- `src/CMakeLists.txt` to build a plugin shared library from sources:
|
||||||
|
|
||||||
@snippet template_plugin/src/CMakeLists.txt cmake:plugin
|
@snippet template/src/CMakeLists.txt cmake:plugin
|
||||||
|
|
||||||
> **NOTE**: `IE::inference_engine` target is imported from the Inference Engine Developer Package.
|
> **NOTE**: `IE::inference_engine` target is imported from the Inference Engine Developer Package.
|
||||||
|
|
||||||
- `tests/functional/CMakeLists.txt` to build a set of functional plugin tests:
|
- `tests/functional/CMakeLists.txt` to build a set of functional plugin tests:
|
||||||
|
|
||||||
@snippet template_plugin/tests/functional/CMakeLists.txt cmake:functional_tests
|
@snippet template/tests/functional/CMakeLists.txt cmake:functional_tests
|
||||||
|
|
||||||
> **NOTE**: The `IE::funcSharedTests` static library with common functional Inference Engine Plugin tests is imported via the Inference Engine Developer Package.
|
> **NOTE**: The `IE::funcSharedTests` static library with common functional Inference Engine Plugin tests is imported via the Inference Engine Developer Package.
|
||||||
|
@ -862,12 +862,10 @@ EXCLUDE_SYMBOLS =
|
|||||||
# that contain example code fragments that are included (see the \include
|
# that contain example code fragments that are included (see the \include
|
||||||
# command).
|
# command).
|
||||||
|
|
||||||
EXAMPLE_PATH = ../template_plugin/src \
|
EXAMPLE_PATH = ../../src/plugins/ \
|
||||||
../template_plugin/include \
|
../../src/plugins/template/tests/functional/CMakeLists.txt \
|
||||||
../template_plugin/src/CMakeLists.txt \
|
../../src/plugins/template/tests/functional/transformations \
|
||||||
../template_plugin/tests/functional/CMakeLists.txt \
|
../../src/plugins/template/tests/functional/shared_tests_instances/ \
|
||||||
../template_plugin/tests/functional/transformations \
|
|
||||||
../template_plugin/tests/functional/shared_tests_instances/ \
|
|
||||||
../../src/tests/functional/plugin/shared/include \
|
../../src/tests/functional/plugin/shared/include \
|
||||||
../snippets
|
../snippets
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ Inference Engine plugin dynamic library consists of several main components:
|
|||||||
|
|
||||||
> **NOTE**: This documentation is written based on the `Template` plugin, which demonstrates plugin
|
> **NOTE**: This documentation is written based on the `Template` plugin, which demonstrates plugin
|
||||||
development details. Find the complete code of the `Template`, which is fully compilable and up-to-date,
|
development details. Find the complete code of the `Template`, which is fully compilable and up-to-date,
|
||||||
at `<openvino source dir>/docs/template_plugin`.
|
at `<openvino source dir>/src/plugins/template`.
|
||||||
|
|
||||||
Detailed guides
|
Detailed guides
|
||||||
-----------------------
|
-----------------------
|
||||||
|
@ -24,7 +24,7 @@ Plugin Class
|
|||||||
Inference Engine Plugin API provides the helper InferenceEngine::IInferencePlugin class recommended to use as a base class for a plugin.
|
Inference Engine Plugin API provides the helper InferenceEngine::IInferencePlugin class recommended to use as a base class for a plugin.
|
||||||
Based on that, declaration of a plugin class can look as follows:
|
Based on that, declaration of a plugin class can look as follows:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.hpp plugin:header
|
@snippet template/src/template_plugin.hpp plugin:header
|
||||||
|
|
||||||
#### Class Fields
|
#### Class Fields
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ The provided plugin class also has several fields:
|
|||||||
* `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
|
* `_waitExecutor` - a task executor that waits for a response from a device about device tasks completion.
|
||||||
* `_cfg` of type `Configuration`:
|
* `_cfg` of type `Configuration`:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_config.hpp configuration:header
|
@snippet template/src/template_config.hpp configuration:header
|
||||||
|
|
||||||
As an example, a plugin configuration has three value parameters:
|
As an example, a plugin configuration has three value parameters:
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ must be thrown from a plugin constructor.
|
|||||||
|
|
||||||
A plugin must define a device name enabled via the `_pluginName` field of a base class:
|
A plugin must define a device name enabled via the `_pluginName` field of a base class:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:ctor
|
@snippet template/src/template_plugin.cpp plugin:ctor
|
||||||
|
|
||||||
### `LoadExeNetworkImpl()`
|
### `LoadExeNetworkImpl()`
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ of the public InferenceEngine::IInferencePlugin::LoadNetwork method that calls p
|
|||||||
This is the most important function of the `Plugin` class and creates an instance of compiled `ExecutableNetwork`,
|
This is the most important function of the `Plugin` class and creates an instance of compiled `ExecutableNetwork`,
|
||||||
which holds a backend-dependent compiled graph in an internal representation:
|
which holds a backend-dependent compiled graph in an internal representation:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:load_exe_network_impl
|
@snippet template/src/template_plugin.cpp plugin:load_exe_network_impl
|
||||||
|
|
||||||
Before a creation of an `ExecutableNetwork` instance via a constructor, a plugin may check if a provided
|
Before a creation of an `ExecutableNetwork` instance via a constructor, a plugin may check if a provided
|
||||||
InferenceEngine::ICNNNetwork object is supported by a device. In the example above, the plugin checks precision information.
|
InferenceEngine::ICNNNetwork object is supported by a device. In the example above, the plugin checks precision information.
|
||||||
@ -84,7 +84,7 @@ The function accepts a const shared pointer to `ov::Model` object and performs t
|
|||||||
* [Intermediate Representation and Operation Sets](../_docs_MO_DG_IR_and_opsets.html)
|
* [Intermediate Representation and Operation Sets](../_docs_MO_DG_IR_and_opsets.html)
|
||||||
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks).
|
* [Quantized networks](@ref openvino_docs_ie_plugin_dg_quantized_networks).
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:transform_network
|
@snippet template/src/template_plugin.cpp plugin:transform_network
|
||||||
|
|
||||||
> **NOTE**: After all these transformations, a `ov::Model` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
|
> **NOTE**: After all these transformations, a `ov::Model` object contains operations which can be perfectly mapped to backend kernels. E.g. if backend has kernel computing `A + B` operations at once, the `TransformNetwork` function should contain a pass which fuses operations `A` and `B` into a single custom operation `A + B` which fits backend kernels set.
|
||||||
|
|
||||||
@ -100,20 +100,20 @@ operations via the InferenceEngine::QueryNetworkResult structure. The `QueryNetw
|
|||||||
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using OpenVINO™ reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
|
3. Construct `supported` and `unsupported` maps which contains names of original operations. Note, that since the inference is performed using OpenVINO™ reference backend, the decision whether the operation is supported or not depends on whether the latest OpenVINO opset contains such operation.
|
||||||
4. `QueryNetworkResult.supportedLayersMap` contains only operations which are fully supported by `_backend`.
|
4. `QueryNetworkResult.supportedLayersMap` contains only operations which are fully supported by `_backend`.
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:query_network
|
@snippet template/src/template_plugin.cpp plugin:query_network
|
||||||
|
|
||||||
### `AddExtension()`
|
### `AddExtension()`
|
||||||
|
|
||||||
Adds an extension of the InferenceEngine::IExtensionPtr type to a plugin. If a plugin does not
|
Adds an extension of the InferenceEngine::IExtensionPtr type to a plugin. If a plugin does not
|
||||||
support extensions, the method must throw an exception:
|
support extensions, the method must throw an exception:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:add_extension
|
@snippet template/src/template_plugin.cpp plugin:add_extension
|
||||||
|
|
||||||
### `SetConfig()`
|
### `SetConfig()`
|
||||||
|
|
||||||
Sets new values for plugin configuration keys:
|
Sets new values for plugin configuration keys:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:set_config
|
@snippet template/src/template_plugin.cpp plugin:set_config
|
||||||
|
|
||||||
In the snippet above, the `Configuration` class overrides previous configuration values with the new
|
In the snippet above, the `Configuration` class overrides previous configuration values with the new
|
||||||
ones. All these values are used during backend specific graph compilation and execution of inference requests.
|
ones. All these values are used during backend specific graph compilation and execution of inference requests.
|
||||||
@ -124,7 +124,7 @@ ones. All these values are used during backend specific graph compilation and ex
|
|||||||
|
|
||||||
Returns a current value for a specified configuration key:
|
Returns a current value for a specified configuration key:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:get_config
|
@snippet template/src/template_plugin.cpp plugin:get_config
|
||||||
|
|
||||||
The function is implemented with the `Configuration::Get` method, which wraps an actual configuration
|
The function is implemented with the `Configuration::Get` method, which wraps an actual configuration
|
||||||
key value to the InferenceEngine::Parameter and returns it.
|
key value to the InferenceEngine::Parameter and returns it.
|
||||||
@ -155,7 +155,7 @@ demonstrates the definition of a new optimization capability value specific for
|
|||||||
|
|
||||||
The snippet below provides an example of the implementation for `GetMetric`:
|
The snippet below provides an example of the implementation for `GetMetric`:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:get_metric
|
@snippet template/src/template_plugin.cpp plugin:get_metric
|
||||||
|
|
||||||
> **NOTE**: If an unsupported metric key is passed to the function, it must throw an exception.
|
> **NOTE**: If an unsupported metric key is passed to the function, it must throw an exception.
|
||||||
|
|
||||||
@ -178,13 +178,13 @@ information must be stored and checked during the import.
|
|||||||
- Compiled backend specific graph itself
|
- Compiled backend specific graph itself
|
||||||
- Information about precisions and shapes set by the user
|
- Information about precisions and shapes set by the user
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:import_network
|
@snippet template/src/template_plugin.cpp plugin:import_network
|
||||||
|
|
||||||
Create Instance of Plugin Class
|
Create Instance of Plugin Class
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Inference Engine plugin library must export only one function creating a plugin instance using IE_DEFINE_PLUGIN_CREATE_FUNCTION macro:
|
Inference Engine plugin library must export only one function creating a plugin instance using IE_DEFINE_PLUGIN_CREATE_FUNCTION macro:
|
||||||
|
|
||||||
@snippet template_plugin/src/template_plugin.cpp plugin:create_plugin_engine
|
@snippet template/src/template_plugin.cpp plugin:create_plugin_engine
|
||||||
|
|
||||||
Next step in a plugin library implementation is the [ExecutableNetwork](@ref openvino_docs_ie_plugin_dg_executable_network) class.
|
Next step in a plugin library implementation is the [ExecutableNetwork](@ref openvino_docs_ie_plugin_dg_executable_network) class.
|
||||||
|
@ -77,7 +77,7 @@ list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dldt_optimization_guide2.c
|
|||||||
# create a static library
|
# create a static library
|
||||||
|
|
||||||
add_library(${TARGET_NAME} STATIC ${SOURCES})
|
add_library(${TARGET_NAME} STATIC ${SOURCES})
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../template_extension/new/")
|
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/template_extension/new/")
|
||||||
|
|
||||||
if(OpenCL_FOUND AND OpenCL_HEADERS)
|
if(OpenCL_FOUND AND OpenCL_HEADERS)
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCL_LIB})
|
target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCL_LIB})
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Copyright (C) 2018-2022 Intel Corporation
|
# Copyright (C) 2018-2022 Intel Corporation
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
add_subdirectory(old)
|
add_subdirectory(old)
|
||||||
add_subdirectory(new)
|
add_subdirectory(new)
|
||||||
|
|
@ -2,12 +2,15 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
|
set(skip_module "${CMAKE_CURRENT_SOURCE_DIR}/template")
|
||||||
file(GLOB local_modules "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
file(GLOB local_modules "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||||
foreach(module_path IN LISTS local_modules)
|
foreach(module_path IN LISTS local_modules)
|
||||||
if( # Skip files
|
if( # Skip files
|
||||||
NOT IS_DIRECTORY ${module_path} OR
|
NOT IS_DIRECTORY ${module_path} OR
|
||||||
# or directories without cmake
|
# or directories without cmake
|
||||||
NOT EXISTS "${module_path}/CMakeLists.txt")
|
NOT EXISTS "${module_path}/CMakeLists.txt" OR
|
||||||
|
# module in the skip list
|
||||||
|
${module_path} STREQUAL ${skip_module})
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(${module_path})
|
add_subdirectory(${module_path})
|
||||||
|
@ -18,6 +18,7 @@ set (SRC
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_library(interpreter_backend STATIC EXCLUDE_FROM_ALL ${SRC})
|
add_library(interpreter_backend STATIC EXCLUDE_FROM_ALL ${SRC})
|
||||||
|
add_library(openvino::interpreter_backend ALIAS interpreter_backend)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ie_add_compiler_flags(-Wno-missing-declarations)
|
ie_add_compiler_flags(-Wno-missing-declarations)
|
@ -30,7 +30,7 @@ target_include_directories(${TARGET_NAME} PRIVATE
|
|||||||
|
|
||||||
# link common Inference Engine libraries
|
# link common Inference Engine libraries
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||||
interpreter_backend
|
openvino::interpreter_backend
|
||||||
openvino::ngraph_reference)
|
openvino::ngraph_reference)
|
||||||
|
|
||||||
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
|
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
|
@ -21,10 +21,6 @@ ov_add_test_target(
|
|||||||
TEMPLATE
|
TEMPLATE
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_HETERO)
|
|
||||||
add_dependencies(${TARGET_NAME} openvino_hetero_plugin)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(OpenCV QUIET COMPONENTS core imgproc)
|
find_package(OpenCV QUIET COMPONENTS core imgproc)
|
||||||
|
|
||||||
if(OpenCV_FOUND)
|
if(OpenCV_FOUND)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user