Unverified Commit ef4692a6 authored by Evgenya Stepyreva's avatar Evgenya Stepyreva Committed by GitHub

Merge rov.2020.2 to master (#4522)

* Export symbols from onnx-import

* Fixed for cross-compilation

* Eliminate mismatch between opset1/opset2 and our real intentions (#4495)

* Removed operations from opset2 that were added to opset1 by mistake; added missing ops

* Fixed wrong include of opset1 to opset2

* Trigger CI

* Fixed code style

* CI triger
Co-authored-by: 's avatarIlya Lavrenov <ilya.lavrenov@intel.com>
Co-authored-by: 's avatarSergey Lyalin <sergey.lyalin@intel.com>
Co-authored-by: 's avatarIlya Churaev <ilya.churaev@intel.com>
Co-authored-by: 's avatarRobert Kimball <robert.kimball@intel.com>
parent 458406c3
......@@ -26,6 +26,7 @@ set(NGRAPH_PROTOBUF_GIT_REPO_URL "https://github.com/protocolbuffers/protobuf")
if(CMAKE_CROSSCOMPILING)
find_program(SYSTEM_PROTOC protoc PATHS ENV PATH)
if(SYSTEM_PROTOC)
execute_process(COMMAND ${SYSTEM_PROTOC} --version OUTPUT_VARIABLE PROTOC_VERSION)
string(REPLACE " " ";" PROTOC_VERSION ${PROTOC_VERSION})
......@@ -123,24 +124,54 @@ else()
set(BUILD_FLAGS "CXXFLAGS=-std=c++${NGRAPH_CXX_STANDARD} -fPIC")
endif()
ExternalProject_Add(
ext_protobuf
PREFIX protobuf
GIT_REPOSITORY ${NGRAPH_PROTOBUF_GIT_REPO_URL}
GIT_TAG ${NGRAPH_PROTOBUF_GIT_TAG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure ${PROTOBUF_SYSTEM_PROTOC} ${PROTOBUF_SYSTEM_PROCESSOR} CXX=${CMAKE_CXX_COMPILER} --prefix=${EXTERNAL_PROJECTS_ROOT}/protobuf --disable-shared
BUILD_COMMAND ${MAKE_UTIL} "${BUILD_FLAGS}"
TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/tmp"
STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/stamp"
DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/download"
SOURCE_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/src"
BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/src"
INSTALL_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf"
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS ${Protobuf_PROTOC_EXECUTABLE} ${Protobuf_LIBRARY}
)
if(PROTOC_VERSION VERSION_GREATER "3.0" AND CMAKE_CROSSCOMPILING)
ExternalProject_Add(
ext_protobuf
PREFIX protobuf
GIT_REPOSITORY ${NGRAPH_PROTOBUF_GIT_REPO_URL}
GIT_TAG ${NGRAPH_PROTOBUF_GIT_TAG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
CMAKE_ARGS
${NGRAPH_FORWARD_CMAKE_ARGS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS=${CMAKE_ORIGINAL_CXX_FLAGS}
-Dprotobuf_WITH_ZLIB=OFF
-Dprotobuf_BUILD_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/protobuf
TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/tmp"
STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/stamp"
DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/download"
SOURCE_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/src"
SOURCE_SUBDIR "cmake"
BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/build"
INSTALL_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf"
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS ${Protobuf_PROTOC_EXECUTABLE} ${Protobuf_LIBRARY}
)
else()
ExternalProject_Add(
ext_protobuf
PREFIX protobuf
GIT_REPOSITORY ${NGRAPH_PROTOBUF_GIT_REPO_URL}
GIT_TAG ${NGRAPH_PROTOBUF_GIT_TAG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure ${PROTOBUF_SYSTEM_PROTOC} ${PROTOBUF_SYSTEM_PROCESSOR} CXX=${CMAKE_CXX_COMPILER} --prefix=${EXTERNAL_PROJECTS_ROOT}/protobuf --disable-shared
BUILD_COMMAND ${MAKE_UTIL} "${BUILD_FLAGS}"
TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/tmp"
STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/stamp"
DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/download"
SOURCE_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/src"
BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf/src"
INSTALL_DIR "${EXTERNAL_PROJECTS_ROOT}/protobuf"
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS ${Protobuf_PROTOC_EXECUTABLE} ${Protobuf_LIBRARY}
)
endif()
endif()
# -----------------------------------------------------------------------------
......
......@@ -15,6 +15,7 @@
# ******************************************************************************
set (SRC
assertion.cpp
assertion.hpp
attribute_adapter.cpp
attribute_adapter.hpp
......
//*****************************************************************************
// Copyright 2017-2020 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include "ngraph/assertion.hpp"
const char* ngraph::AssertionFailure::what() const noexcept
{
return m_what.c_str();
}
......@@ -40,7 +40,7 @@
namespace ngraph
{
/// Base class for ngraph assertion failure exceptions.
class AssertionFailure : public ngraph_error
class NGRAPH_API AssertionFailure : public ngraph_error
{
public:
AssertionFailure(const std::string& what_arg)
......@@ -55,7 +55,8 @@ namespace ngraph
{
}
const char* what() const noexcept override { return m_what.c_str(); }
const char* what() const noexcept override;
private:
std::string m_what;
};
......
......@@ -247,7 +247,11 @@ set(ONNX_IMPORT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")
add_dependencies(onnx_import_interface onnx onnx_proto)
add_dependencies(onnx_import onnx_import_interface)
set_property(TARGET onnx_import PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(onnx_import PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
POSITION_INDEPENDENT_CODE ON)
target_include_directories(onnx_import
SYSTEM PRIVATE ${ONNX_IMPORT_INCLUDE_DIR} ${NGRAPH_INCLUDE_PATH}
SYSTEM PRIVATE ${ONNX_INCLUDE_DIR} ${ONNX_PROTO_INCLUDE_DIR} ${Protobuf_INCLUDE_DIR})
......@@ -255,7 +259,11 @@ target_link_libraries(onnx_import PRIVATE ${Protobuf_LIBRARIES} onnx_proto)
target_compile_definitions(onnx_import PRIVATE ONNX_OPSET_VERSION=${ONNX_OPSET_VERSION})
set_property(TARGET onnx_import_interface PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(onnx_import_interface PROPERTIES
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
POSITION_INDEPENDENT_CODE ON)
target_include_directories(onnx_import_interface SYSTEM PRIVATE ${ONNX_IMPORT_INCLUDE_DIR} ${NGRAPH_INCLUDE_PATH}
SYSTEM PRIVATE ${ONNX_INCLUDE_DIR} ${ONNX_PROTO_INCLUDE_DIR} ${Protobuf_INCLUDE_DIR})
......
......@@ -21,7 +21,137 @@
#define NGRAPH_OP(x, y)
#endif
#include "opset1_tbl.hpp"
NGRAPH_OP(Abs, ngraph::op::v0)
NGRAPH_OP(Acos, ngraph::op::v0)
NGRAPH_OP(Add, ngraph::op::v1)
NGRAPH_OP(Asin, ngraph::op::v0)
NGRAPH_OP(Atan, ngraph::op::v0)
NGRAPH_OP(AvgPool, ngraph::op::v1)
NGRAPH_OP(BatchNormInference, ngraph::op::v0)
NGRAPH_OP(BinaryConvolution, ngraph::op::v1)
NGRAPH_OP(Broadcast, ngraph::op::v1)
NGRAPH_OP(CTCGreedyDecoder, ngraph::op::v0)
NGRAPH_OP(Ceiling, ngraph::op::v0)
NGRAPH_OP(Clamp, ngraph::op::v0)
NGRAPH_OP(Concat, ngraph::op::v0)
NGRAPH_OP(Constant, ngraph::op)
NGRAPH_OP(Convert, ngraph::op::v0)
NGRAPH_OP(ConvertLike, ngraph::op::v1)
NGRAPH_OP(Convolution, ngraph::op::v1)
NGRAPH_OP(ConvolutionBackpropData, ngraph::op::v1)
NGRAPH_OP(Cos, ngraph::op::v0)
NGRAPH_OP(Cosh, ngraph::op::v0)
NGRAPH_OP(DeformableConvolution, ngraph::op::v1)
NGRAPH_OP(DeformablePSROIPooling, ngraph::op::v1)
NGRAPH_OP(DepthToSpace, ngraph::op::v0)
NGRAPH_OP(DetectionOutput, ngraph::op::v0)
NGRAPH_OP(Divide, ngraph::op::v1)
NGRAPH_OP(Elu, ngraph::op::v0)
NGRAPH_OP(Erf, ngraph::op::v0)
NGRAPH_OP(Equal, ngraph::op::v1)
NGRAPH_OP(Exp, ngraph::op::v0)
NGRAPH_OP(FakeQuantize, ngraph::op::v0)
NGRAPH_OP(Floor, ngraph::op::v0)
NGRAPH_OP(FloorMod, ngraph::op::v1)
NGRAPH_OP(Gather, ngraph::op::v1)
NGRAPH_OP(GatherTree, ngraph::op::v1)
NGRAPH_OP(Greater, ngraph::op::v1)
NGRAPH_OP(GreaterEqual, ngraph::op::v1)
NGRAPH_OP(GroupConvolution, ngraph::op::v1)
NGRAPH_OP(GroupConvolutionBackpropData, ngraph::op::v1)
NGRAPH_OP(GRN, ngraph::op::v0)
NGRAPH_OP(HardSigmoid, ngraph::op::v0)
NGRAPH_OP(Interpolate, ngraph::op::v0)
NGRAPH_OP(Less, ngraph::op::v1)
NGRAPH_OP(LessEqual, ngraph::op::v1)
NGRAPH_OP(Log, ngraph::op::v0)
NGRAPH_OP(LogicalAnd, ngraph::op::v1)
NGRAPH_OP(LogicalNot, ngraph::op::v1)
NGRAPH_OP(LogicalOr, ngraph::op::v1)
NGRAPH_OP(LogicalXor, ngraph::op::v1)
NGRAPH_OP(LRN, ngraph::op::v0)
NGRAPH_OP(LSTMCell, ngraph::op::v0)
NGRAPH_OP(LSTMSequence, ngraph::op::v0)
NGRAPH_OP(MatMul, ngraph::op::v0)
NGRAPH_OP(MaxPool, ngraph::op::v1)
NGRAPH_OP(Maximum, ngraph::op::v1)
NGRAPH_OP(Minimum, ngraph::op::v1)
NGRAPH_OP(Mod, ngraph::op::v1)
NGRAPH_OP(Multiply, ngraph::op::v1)
NGRAPH_OP(MVN, ngraph::op::v0) // Missing in opset1
NGRAPH_OP(Negative, ngraph::op::v0)
NGRAPH_OP(NonMaxSuppression, ngraph::op::v1)
NGRAPH_OP(NormalizeL2, ngraph::op::v0)
NGRAPH_OP(NotEqual, ngraph::op::v1)
NGRAPH_OP(OneHot, ngraph::op::v1)
NGRAPH_OP(PRelu, ngraph::op::v0)
NGRAPH_OP(PSROIPooling, ngraph::op::v0)
NGRAPH_OP(Pad, ngraph::op::v1)
NGRAPH_OP(Parameter, ngraph::op::v0)
NGRAPH_OP(Power, ngraph::op::v1)
NGRAPH_OP(PriorBox, ngraph::op::v0)
NGRAPH_OP(PriorBoxClustered, ngraph::op::v0)
NGRAPH_OP(Proposal, ngraph::op::v0)
NGRAPH_OP(Range, ngraph::op::v0)
NGRAPH_OP(Relu, ngraph::op::v0)
NGRAPH_OP(ReduceMax, ngraph::op::v1)
NGRAPH_OP(ReduceLogicalAnd, ngraph::op::v1)
NGRAPH_OP(ReduceLogicalOr, ngraph::op::v1)
NGRAPH_OP(ReduceMean, ngraph::op::v1)
NGRAPH_OP(ReduceMin, ngraph::op::v1)
NGRAPH_OP(ReduceProd, ngraph::op::v1)
NGRAPH_OP(ReduceSum, ngraph::op::v1)
NGRAPH_OP(RegionYolo, ngraph::op::v0)
NGRAPH_OP(ReorgYolo, ngraph::op::v0) // Missing in opset1
NGRAPH_OP(Reshape, ngraph::op::v1)
NGRAPH_OP(Result, ngraph::op::v0)
// Moved out of opset2, it was added to opset1 by mistake
// NGRAPH_OP(Reverse, ngraph::op::v1)
NGRAPH_OP(ReverseSequence, ngraph::op::v0)
// Moved out of opset2, it was added to opset1 by mistake
// NGRAPH_OP(RNNCell, ngraph::op::v0)
NGRAPH_OP(ROIPooling, ngraph::op::v0) // Missing in opset1
NGRAPH_OP(Select, ngraph::op::v1)
NGRAPH_OP(Selu, ngraph::op::v0)
NGRAPH_OP(ShapeOf, ngraph::op::v0)
// Moved out of opset2, it was added to opset1 by mistake
// NGRAPH_OP(ShuffleChannels, ngraph::op::v0)
NGRAPH_OP(Sign, ngraph::op::v0)
NGRAPH_OP(Sigmoid, ngraph::op::v0)
NGRAPH_OP(Sin, ngraph::op::v0)
NGRAPH_OP(Sinh, ngraph::op::v0)
NGRAPH_OP(Softmax, ngraph::op::v1)
NGRAPH_OP(Sqrt, ngraph::op::v0)
NGRAPH_OP(SpaceToDepth, ngraph::op::v0)
NGRAPH_OP(Split, ngraph::op::v1)
NGRAPH_OP(SquaredDifference, ngraph::op::v0)
NGRAPH_OP(Squeeze, ngraph::op::v0)
NGRAPH_OP(StridedSlice, ngraph::op::v1)
NGRAPH_OP(Subtract, ngraph::op::v1)
NGRAPH_OP(Tan, ngraph::op::v0)
NGRAPH_OP(Tanh, ngraph::op::v0)
NGRAPH_OP(TensorIterator, ngraph::op::v0)
NGRAPH_OP(Tile, ngraph::op::v0)
NGRAPH_OP(TopK, ngraph::op::v1)
NGRAPH_OP(Transpose, ngraph::op::v1)
NGRAPH_OP(Unsqueeze, ngraph::op::v0)
NGRAPH_OP(VariadicSplit, ngraph::op::v1)
// Moved out of opset2, it was added to opset1 by mistake
// NGRAPH_OP(Xor, ngraph::op::v0)
// New operations added in opset2
NGRAPH_OP(Gelu, ngraph::op::v0)
NGRAPH_OP(BatchToSpace, ngraph::op::v1)
NGRAPH_OP(SpaceToBatch, ngraph::op::v1)
......@@ -58,7 +58,7 @@ public:
/// \brief Query the list of registered devices
/// \returns A vector of all registered devices.
static std::vector<std::string> get_registered_backends();
static NGRAPH_API std::vector<std::string> get_registered_backends();
private:
static void initialize_backends();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment