Skip to content

Commit

Permalink
Merge branch 'master' into rounding_guard
Browse files Browse the repository at this point in the history
  • Loading branch information
mlukasze committed Jul 7, 2023
2 parents 2ea4df4 + df2ed95 commit e18c3f3
Show file tree
Hide file tree
Showing 82 changed files with 3,822 additions and 2,438 deletions.
2 changes: 0 additions & 2 deletions cmake/developer_package/IEDevScriptsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ endif()

include(packaging/packaging)

set(CMAKE_SKIP_INSTALL_RPATH ON)

if(APPLE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)

Expand Down
9 changes: 5 additions & 4 deletions cmake/developer_package/packaging/common-libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ macro(ov_common_libraries_cpack_set_dirs)
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})

if(CPACK_GENERATOR STREQUAL "BREW")
set(CMAKE_SKIP_INSTALL_RPATH OFF)
endif()
endmacro()

ov_common_libraries_cpack_set_dirs()
Expand Down Expand Up @@ -123,3 +119,8 @@ macro(ov_define_component_include_rules)
endmacro()

ov_define_component_include_rules()

if(CPACK_GENERATOR STREQUAL "BREW")
# brew relies on RPATH
set(CMAKE_SKIP_INSTALL_RPATH OFF)
endif()
3 changes: 3 additions & 0 deletions cmake/developer_package/packaging/debian/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ macro(ov_debian_specific_settings)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif()
endif()

# we don't need RPATHs, because libraries are search by standard paths
set(CMAKE_SKIP_INSTALL_RPATH ON)
endmacro()

ov_debian_specific_settings()
Expand Down
3 changes: 3 additions & 0 deletions cmake/developer_package/packaging/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

include(CPackComponent)

# we don't need RPATHs, because setupvars.sh is used
set(CMAKE_SKIP_INSTALL_RPATH ON)

#
# ov_install_static_lib(<target> <comp>)
#
Expand Down
3 changes: 3 additions & 0 deletions cmake/developer_package/packaging/rpm/rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ macro(ov_rpm_specific_settings)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif()
endif()

# we don't need RPATHs, because libraries are search by standard paths
set(CMAKE_SKIP_INSTALL_RPATH ON)
endmacro()

ov_rpm_specific_settings()
Expand Down
4 changes: 3 additions & 1 deletion cmake/templates/OpenVINOConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ endmacro()

macro(_ov_find_protobuf_frontend_dependency)
set(_OV_ENABLE_SYSTEM_PROTOBUF "@ENABLE_SYSTEM_PROTOBUF@")
set(_OV_PROTOBUF_PACKAGE_CONFIG "@protobuf_config@")
if(_OV_ENABLE_SYSTEM_PROTOBUF)
_ov_find_dependency(Protobuf @Protobuf_VERSION@ EXACT NAMES Protobuf protobuf)
_ov_find_dependency(Protobuf @Protobuf_VERSION@ EXACT ${_OV_PROTOBUF_PACKAGE_CONFIG})
endif()
unset(_OV_PROTOBUF_PACKAGE_CONFIG)
unset(_OV_ENABLE_SYSTEM_PROTOBUF)
endmacro()

Expand Down
4 changes: 2 additions & 2 deletions docs/OV_Runtime_UG/supported_plugins/GNA.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exported for GNA 2.0 runs on GNA 3.0 or vice versa.

In most cases, a network compiled for GNA 2.0 runs as expected on GNA 3.0. However, performance may be worse
compared to when a network is compiled specifically for the latter. The exception is a network with convolutions
with the number of filters greater than 8192 (see the :ref:`Model and Operation Limitations <#model-and-operation-limitations>` section).
with the number of filters greater than 8192 (see the `Model and Operation Limitations <#model-and-operation-limitations>`__ section).


For optimal work with POT quantized models, which include 2D convolutions on GNA 3.0 hardware, the following requirements should be satisfied:
Expand Down Expand Up @@ -136,7 +136,7 @@ quantization hints based on statistics for the provided dataset.
* Performance (i8 weights)

For POT quantized models, the ``ov::hint::inference_precision`` property has no effect except in cases described in the
:ref:`Model and Operation Limitations section <#model-and-operation-limitations>`.
`Model and Operation Limitations section <#model-and-operation-limitations>`__.


Supported Features
Expand Down
24 changes: 14 additions & 10 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,27 @@ ul#navbar-main-elements > li:hover {
transform: rotate(0deg);
}


/* Footer links */
/* Footer */
/* =================================================== */
footer div.container div.footer-item p a {
float: left;
margin-right: 30px;
footer iframe {
background-color: white;
width: 100%;
border: none;
height: 60px;
}

footer div.container div.footer-item p a:nth-child(1) {
margin-right: 50px;
@media screen and (min-width: 860px) {
footer iframe {
height: 45px;
}
}

footer div.container div.footer-item p:nth-child(2) {
clear: both;
@media screen and (max-width: 520px) {
footer iframe {
height: 85px;
}
}


/* Doc version dropdown formatting override */
/* =================================================== */
[aria-labelledby="version-selector"] {
Expand Down
4 changes: 2 additions & 2 deletions docs/install_guides/installing-openvino-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ The best way to get started with OpenVINO is to install OpenVINO Development Too

**Python**

For developers working in Python, OpenVINO Development Tools can easily be installed using PyPI. See the :ref:`For Python Developers <openvino_docs_install_guides_install_dev_tools.html#python_developers>` section of the Install OpenVINO Development Tools page for instructions.
For developers working in Python, OpenVINO Development Tools can easily be installed using PyPI. See the :ref:`For Python Developers <python_developers>` section of the Install OpenVINO Development Tools page for instructions.

**C++**

For developers working in C++, the core OpenVINO Runtime libraries must be installed separately. Then, OpenVINO Development Tools can be installed using requirements files or PyPI. See the :ref:`For C++ Developers <openvino_docs_install_guides_install_dev_tools.html#cpp_developers>` section of the Install OpenVINO Development Tools page for instructions.
For developers working in C++, the core OpenVINO Runtime libraries must be installed separately. Then, OpenVINO Development Tools can be installed using requirements files or PyPI. See the :ref:`For C++ Developers <cpp_developers>` section of the Install OpenVINO Development Tools page for instructions.

Install OpenVINO Runtime only
+++++++++++++++++++++++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer class="footer mt-5 mt-md-0">
<iframe src="../footer.html"></iframe>
</footer>

This file was deleted.

22 changes: 19 additions & 3 deletions src/bindings/c/include/c_api/ie_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,37 @@
# define INFERENCE_ENGINE_C_API_EXTERN
#endif

#define IE_1_0_DEPRECATED \
OPENVINO_DEPRECATED("The Inference Engine API is deprecated and will be removed in the 2024.0 release. " \
"For instructions on transitioning to the new API, please refer to " \
"https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")

#if !defined(IN_OV_COMPONENT) && !defined(C_API_LEGACY_HEADER_INCLUDED)
# define C_API_LEGACY_HEADER_INCLUDED
# ifdef _MSC_VER
# pragma message(
"The legacy C API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")
# else
# warning("The legacy C API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")
# endif
#endif

#if defined(OPENVINO_STATIC_LIBRARY) || defined(__GNUC__) && (__GNUC__ < 4)
# define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __VA_ARGS__
# define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __VA_ARGS__ IE_1_0_DEPRECATED
# define IE_NODISCARD
#else
# if defined(_WIN32) || defined(__CYGWIN__)
# define INFERENCE_ENGINE_C_API_CALLBACK __cdecl
# ifdef openvino_c_EXPORTS
# define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __declspec(dllexport) __VA_ARGS__ __cdecl
# else
# define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __declspec(dllimport) __VA_ARGS__ __cdecl
# define INFERENCE_ENGINE_C_API(...) \
INFERENCE_ENGINE_C_API_EXTERN __declspec(dllimport) __VA_ARGS__ IE_1_0_DEPRECATED __cdecl
# endif
# define IE_NODISCARD
# else
# define INFERENCE_ENGINE_C_API(...) \
INFERENCE_ENGINE_C_API_EXTERN __attribute__((visibility("default"))) __VA_ARGS__
INFERENCE_ENGINE_C_API_EXTERN __attribute__((visibility("default"))) __VA_ARGS__ IE_1_0_DEPRECATED
# define IE_NODISCARD __attribute__((warn_unused_result))
# endif
#endif
Expand Down
1 change: 1 addition & 0 deletions src/bindings/c/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(TARGET_NAME openvino_c)

# Suppress warnings due to catch macro with legacy exception types
ov_deprecated_no_errors()
add_definitions(-DIN_OV_COMPONENT)

file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB_RECURSE HEADERS ${OpenVINO_C_API_SOURCE_DIR}/include/*.h)
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/c/src/ie_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1706,4 +1706,4 @@ void ie_blob_free(ie_blob_t** blob) {

void ie_shutdown() {
InferenceEngine::shutdown();
}
}
13 changes: 10 additions & 3 deletions src/bindings/c/tests/ie_c_api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
#include <gtest/gtest.h>
#include <stdio.h>
#include <stdlib.h>

#include <condition_variable>
#include <fstream>
#include "inference_engine.hpp"
#include <mutex>
#include <c_api/ie_c_api.h>
#include <inference_engine.hpp>

#include "test_model_repo.hpp"
#include <fstream>

#define IE_EXPECT_OK(...) EXPECT_EQ(IEStatusCode::OK, __VA_ARGS__)
#define IE_ASSERT_OK(...) ASSERT_EQ(IEStatusCode::OK, __VA_ARGS__)
#define IE_EXPECT_NOT_OK(...) EXPECT_NE(IEStatusCode::OK, __VA_ARGS__)

OPENVINO_SUPPRESS_DEPRECATED_START

#include <c_api/ie_c_api.h>

static std::mutex m;
static bool ready = false;
static std::condition_variable condVar;
Expand Down Expand Up @@ -1503,3 +1508,5 @@ TEST_P(ie_c_api_test, ie_infer_set_completion_callback) {
ie_network_free(&network);
ie_core_free(&core);
}

OPENVINO_SUPPRESS_DEPRECATED_END
2 changes: 2 additions & 0 deletions src/core/include/openvino/core/node_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class OPENVINO_API Output<Node> {
descriptor::Tensor& get_tensor() const;
/// \return A shared point to the tensor ptr for this output.
std::shared_ptr<descriptor::Tensor> get_tensor_ptr() const;
/// \return Set new tensor desc shared pointer to this output
void set_tensor_ptr(std::shared_ptr<descriptor::Tensor> tensor_ptr);
/// \return The element type of the output referred to by this output handle.
const element::Type& get_element_type() const;
/// \return The shape of the output referred to by this output handle.
Expand Down
122 changes: 122 additions & 0 deletions src/core/shape_inference/include/element_visitor.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include <functional>

#include "openvino/core/except.hpp"
#include "openvino/core/type/element_type.hpp"

namespace ov {
namespace element {

/**
* @brief Primary template defines suppoted element types.
*
* The list of element types is used to check if runtime value of element type is one in the list.
* Base on this check the Visitor::visit function is called for specific element type.
*
* @tparam List of supported ov::element types.
*/
template <Type_t...>
struct IfTypeOf;

/**
* @brief Applies visitor action for not supported ov::element type.
*/
template <>
struct IfTypeOf<> {
/**
* @brief Applies visitor default action if input element type is not not supported by IfTypeOf.
*
* Uses Visitor::visit non-template function.
*
* @tparam Visitor Visitor class implementing visit function.
* @tparam Args Types of visit parameters.
*
* @param et Input element type.
* @param args Visitor arguments.
* @return Value of result type returned by Visitor.
*/
template <class Visitor, class... Args>
static auto apply(Type_t et, Args&&... args) -> typename Visitor::result_type {
return Visitor::visit();
}
};

/**
* @brief Applies visitor action for supported element type defined by template parameters.
*
* @tparam ET Current ov::element type used for check with input.
* @tparam Others Others supported ov::element.
*/
template <Type_t ET, Type_t... Others>
struct IfTypeOf<ET, Others...> {
/**
* @brief Applies visitor action if input element type is same as ET.
*
* Uses Visitor::visit<ET> function if `et == ET`, otherwise check input element type against Others.
*
* @tparam Visitor Visitor class implementing visit function.
* @tparam Args Types of visit parameters.
*
* @param et Input element type.
* @param args Visitor arguments.
* @return Value of result type returned by Visitor.
*/
template <class Visitor, class... Args>
static auto apply(Type_t et, Args&&... args) -> typename Visitor::result_type {
return (et == ET) ? Visitor::template visit<ET>(std::forward<Args>(args)...)
: IfTypeOf<Others...>::template apply<Visitor>(et, std::forward<Args>(args)...);
}
};

/**
* @brief Helper visitor which defines no action for not supported type.
*
* @tparam R Type of return value.
* @tparam value Default value returned.
*/
template <class R, R... value>
struct NoAction {
static_assert(sizeof...(value) < 2, "There should be no more than one result value.");

using result_type = R;

static constexpr result_type visit() {
return {value...};
}
};

/**
* @brief Helper visitor which defines no action for not supported type if result is void type.
*/
template <>
struct NoAction<void> {
using result_type = void;

static result_type visit() {}
};

/**
* @brief Helper visitor which throws ov::Exception for not supported element type.
*
* @tparam R Type of return value.
*/
template <class R>
struct NotSupported {
using result_type = R;

[[noreturn]] static result_type visit() {
throw_not_supported();
}

private:
[[noreturn]] static void throw_not_supported() {
OPENVINO_THROW("Element not supported");
}
};
} // namespace element
} // namespace ov
Loading

0 comments on commit e18c3f3

Please sign in to comment.