2021-03-25 02:40:09 +03:00
|
|
|
# Copyright (C) 2018-2021 Intel Corporation
|
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2021-02-03 13:13:56 +03:00
|
|
|
#
|
|
|
|
|
|
2021-07-16 18:55:05 +03:00
|
|
|
if(SUGGEST_OVERRIDE_SUPPORTED)
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
if(ENABLE_LTO)
|
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-22 17:39:39 +03:00
|
|
|
add_subdirectory(ittapi EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(itt_collector EXCLUDE_FROM_ALL)
|
2021-06-03 12:22:06 +03:00
|
|
|
add_subdirectory(zlib EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(cnpy EXCLUDE_FROM_ALL)
|
2021-09-23 18:42:19 +03:00
|
|
|
if(ENABLE_CLDNN)
|
|
|
|
|
add_subdirectory(ocl EXCLUDE_FROM_ALL)
|
|
|
|
|
endif()
|
2021-06-22 17:39:39 +03:00
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
add_subdirectory(xbyak EXCLUDE_FROM_ALL)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS xbyak)
|
|
|
|
|
|
2021-07-02 11:36:31 +03:00
|
|
|
#
|
|
|
|
|
# Pugixml
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if(ENABLE_SYSTEM_PUGIXML)
|
|
|
|
|
find_package(PugiXML REQUIRED)
|
|
|
|
|
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)
|
|
|
|
|
add_library(pugixml::static ALIAS pugixml)
|
|
|
|
|
else()
|
|
|
|
|
function(ie_build_pugixml)
|
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
|
add_subdirectory(pugixml EXCLUDE_FROM_ALL)
|
|
|
|
|
set_property(TARGET pugixml-static PROPERTY EXPORT_NAME pugixml)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS pugixml::static)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
ie_build_pugixml()
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
#
|
|
|
|
|
# Fluid, G-API, OpenCV HAL
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
add_library(ocv_hal INTERFACE)
|
|
|
|
|
target_include_directories(ocv_hal INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/ocv")
|
|
|
|
|
|
|
|
|
|
add_subdirectory(ade EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(fluid/modules/gapi EXCLUDE_FROM_ALL)
|
|
|
|
|
set_target_properties(ade fluid PROPERTIES FOLDER thirdparty)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS ade fluid)
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Gflags
|
|
|
|
|
#
|
|
|
|
|
|
2021-08-11 11:33:52 +03:00
|
|
|
add_subdirectory(gflags EXCLUDE_FROM_ALL)
|
|
|
|
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS gflags)
|
2021-06-23 09:53:18 +03:00
|
|
|
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
|
|
|
|
# Google Tests framework
|
|
|
|
|
#
|
|
|
|
|
|
2021-08-11 11:33:52 +03:00
|
|
|
if(NGRAPH_UNIT_TEST_ENABLE OR ENABLE_TESTS)
|
2021-06-22 17:39:39 +03:00
|
|
|
add_subdirectory(gtest EXCLUDE_FROM_ALL)
|
|
|
|
|
|
2021-07-02 17:17:44 +03:00
|
|
|
openvino_developer_export_targets(COMPONENT inference_engine_tests
|
|
|
|
|
TARGETS gmock gmock_main gtest gtest_main)
|
2021-06-22 17:39:39 +03:00
|
|
|
endif()
|
|
|
|
|
|
2021-07-16 18:55:05 +03:00
|
|
|
#
|
|
|
|
|
# Protobuf
|
|
|
|
|
#
|
|
|
|
|
|
Merge TensorFlow Frontend Implementation (#7855)
* Migrate POC for TensorFlow frontend
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Refactor InputModelTensorFlow API
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Repack POC to official API
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Remove tensorflow API from public include
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Make TF frontend work from MO and clean-up code
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply codestyle
* Fix win biuld
* Fix Linux build
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Implement Place class
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Determine outputs from graph
* Implement all Place classes
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Make small clean-up
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code-style corrections
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Determine cut nodes
* Apply codestyle
* Rework to use places
* Fix conversion issue
* Fix build
* Fix conversion
* Small fixes
* Add test for tf frontend
* Add tests
* Implement partial conversion
* Use dynamic type in TFFrameworkNode
* Fix build on Linux
* Implement InputModelTF class
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix code by replacing InputModelTensorFlow to InputModelTF
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix to pass getPlaceByTensorName test
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Refactor and clean the code
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Finalize refactoring code
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Support freezing inputs
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Add support for pruning input ports as new model output
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code-style fixes
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* move op convertors to separate files, refactoring
* openvino codestyle
* openvino codestyle
* fix crash of layer tests
* fix missprint
* Implement TensorFlow NodeContext and DecoderTFProto classes
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Switch to new NodeContext
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Remove ngraph_builder class and node_context_impl class
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Move decoder/graph_iterator to separate files and remove old files
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Document Decoder, GraphIterator, and NodeContext classes
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code style
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Remove empty file graph_iterator_proto.cpp and redundant comments
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Use base class for GraphIterator in model class and correct exception class
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Use ends_with from util library
* Remain only InputModelTF constructor with GraphIterator and adopt other code
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Correct code after merge
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code style
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix code based on feedback: delete extra namespace usage, etc.
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Make legacy TF frontend default in MO and avoid reading tf models from ReadNetwork
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix build issue with FrameworkNode after upstream merge
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Correct frontend name in test and clean the code
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* refactoring of tf FrontEnd: rename namespaces, delete default opset
* codestyle
* fix e2e tests
* change namespaces of external classes
* resolve review comment
* codestyle
* Clean useless comments and fix tests
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Add copyright for proto files
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Make op translators a part of FrontEndTF
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Align CMakeLists.txt file with other frontends
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Add job_pool into CMakeLists.txt for tensorflow tests
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Remove cout and WA in ie_network_reader.cpp
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Correct DecoderBase and FrontEndTF methods, clean the code from if 0, utility.hpp, ngraph_conversions.hpp
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Clean operation translator code and remove empty implementation
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Extend cmake template files with tensorflow frontend
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code-style
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix build issues on MacOS and apply review feedback
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Remove ConstantFolding pass, add destructors for DecoderBase, GraphIterator, and fix Win build
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix Windows build issue
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply code-style fix
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix issues with code style: remove virtual keyword, OpMap removal
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Resolve review remarks
* Resolve review remarks
* codestyle
* resolve review remarks
* fix copyright
* resolve review comments
Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com>
2021-10-14 10:36:10 +03:00
|
|
|
if(NGRAPH_PDPD_FRONTEND_ENABLE OR NGRAPH_ONNX_FRONTEND_ENABLE OR NGRAPH_TF_FRONTEND_ENABLE)
|
2021-07-16 18:55:05 +03:00
|
|
|
if(NGRAPH_USE_SYSTEM_PROTOBUF)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(Protobuf_USE_STATIC_LIBS ON)
|
|
|
|
|
if(VERBOSE_BUILD)
|
|
|
|
|
set(Protobuf_DEBUG ON)
|
|
|
|
|
endif()
|
2021-07-22 11:56:40 +03:00
|
|
|
find_package(Protobuf 3.9.0 REQUIRED)
|
2021-07-22 19:13:43 +03:00
|
|
|
set(Protobuf_LITE_LIBRARIES protobuf::libprotobuf-lite)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(SYSTEM_PROTOC protobuf::protoc)
|
|
|
|
|
set(PROTOC_EXECUTABLE ${SYSTEM_PROTOC})
|
|
|
|
|
|
2021-08-02 13:48:33 +03:00
|
|
|
foreach(target ${SYSTEM_PROTOC} ${Protobuf_LITE_LIBRARIES})
|
2021-07-20 18:13:22 +03:00
|
|
|
set_property(TARGET ${target} PROPERTY IMPORTED_GLOBAL TRUE)
|
|
|
|
|
endforeach()
|
2021-07-16 18:55:05 +03:00
|
|
|
else()
|
|
|
|
|
add_subdirectory(protobuf)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# forward variables used in the other places
|
|
|
|
|
set(SYSTEM_PROTOC ${SYSTEM_PROTOC} PARENT_SCOPE)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(PROTOC_EXECUTABLE ${PROTOC_EXECUTABLE} PARENT_SCOPE)
|
2021-07-22 19:13:43 +03:00
|
|
|
set(Protobuf_LITE_LIBRARIES ${Protobuf_LITE_LIBRARIES} PARENT_SCOPE)
|
2021-07-16 18:55:05 +03:00
|
|
|
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIRS} PARENT_SCOPE)
|
2021-07-20 18:13:22 +03:00
|
|
|
|
|
|
|
|
# set public / interface compile options
|
2021-08-02 13:48:33 +03:00
|
|
|
foreach(target IN LISTS Protobuf_LITE_LIBRARIES)
|
2021-07-20 18:13:22 +03:00
|
|
|
set(link_type PUBLIC)
|
|
|
|
|
if(NGRAPH_USE_SYSTEM_PROTOBUF)
|
|
|
|
|
set(link_type INTERFACE)
|
|
|
|
|
endif()
|
2021-07-21 13:56:55 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
|
2021-07-20 18:13:22 +03:00
|
|
|
target_compile_options(${target} ${link_type} -Wno-undef)
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
2021-07-16 18:55:05 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# ONNX
|
|
|
|
|
#
|
|
|
|
|
|
2021-08-11 18:01:27 +02:00
|
|
|
if(NGRAPH_ONNX_FRONTEND_ENABLE)
|
2021-07-16 18:55:05 +03:00
|
|
|
add_subdirectory(onnx)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-09-21 09:48:16 +03:00
|
|
|
#
|
|
|
|
|
# oneDNN for GPU plugin
|
|
|
|
|
#
|
2021-10-05 04:26:01 +03:00
|
|
|
if (ANDROID OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
|
2021-09-21 09:48:16 +03:00
|
|
|
# oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN
|
|
|
|
|
set(ENABLE_ONEDNN_FOR_GPU OFF CACHE BOOL "")
|
|
|
|
|
else()
|
|
|
|
|
set(ENABLE_ONEDNN_FOR_GPU ON CACHE BOOL "")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_ONEDNN_FOR_GPU)
|
|
|
|
|
function(build_onednn_gpu)
|
|
|
|
|
include(ExternalProject)
|
|
|
|
|
set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build/")
|
|
|
|
|
set(ONEDNN_INSTALL_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
|
|
|
|
set(ONEDNN_LIBRARY "${ONEDNN_BUILD_DIR}/src/${CMAKE_STATIC_LIBRARY_PREFIX}onednn_gpu${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
|
set(ONEDNN_OUTPUT_LIBRARY "${ONEDNN_INSTALL_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}onednn_gpu${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2021-11-01 17:59:30 +03:00
|
|
|
|
|
|
|
|
# Get processors count to limit number of threads spawned by make
|
|
|
|
|
include(ProcessorCount)
|
|
|
|
|
ProcessorCount(CORES_COUNT)
|
|
|
|
|
if(CORES_COUNT EQUAL 0)
|
|
|
|
|
set(CORES_COUNT "")
|
|
|
|
|
endif()
|
2021-09-21 09:48:16 +03:00
|
|
|
ExternalProject_Add(onednn_gpu_build
|
|
|
|
|
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu"
|
|
|
|
|
BINARY_DIR "${ONEDNN_BUILD_DIR}"
|
|
|
|
|
INSTALL_DIR "${ONEDNN_INSTALL_DIR}"
|
|
|
|
|
PREFIX onednn_gpu_build
|
|
|
|
|
EXCLUDE_FROM_ALL ON
|
|
|
|
|
CMAKE_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
|
|
|
|
|
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
|
|
|
|
|
"-DDNNL_CPU_RUNTIME=NONE"
|
|
|
|
|
"-DDNNL_GPU_RUNTIME=OCL"
|
|
|
|
|
"-DDNNL_GPU_RUNTIME=OCL"
|
|
|
|
|
"-DDNNL_LIBRARY_NAME=onednn_gpu"
|
|
|
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
|
|
|
|
|
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
|
|
|
|
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
|
|
|
|
"-DDNNL_ENABLE_CONCURRENT_EXEC=ON"
|
|
|
|
|
"-DDNNL_ENABLE_PRIMITIVE_CACHE=ON"
|
|
|
|
|
"-DDNNL_BUILD_TESTS=OFF"
|
|
|
|
|
"-DDNNL_BUILD_EXAMPLES=OFF"
|
|
|
|
|
"-DDNNL_BLAS_VENDOR=NONE"
|
|
|
|
|
"-DDNNL_LIBRARY_TYPE=STATIC"
|
|
|
|
|
"-DOpenCL_LIBRARY=${OpenCL_LIBRARY}"
|
|
|
|
|
"-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIR}"
|
|
|
|
|
"-DOPENCL_VERSION_2_2=${OPENCL_VERSION_2_2}"
|
2021-11-01 17:59:30 +03:00
|
|
|
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target onednn_gpu --parallel ${CORES_COUNT}
|
2021-09-21 09:48:16 +03:00
|
|
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${ONEDNN_LIBRARY} ${ONEDNN_OUTPUT_LIBRARY}
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "OneDNN $<CONFIG> build for GPU complete"
|
|
|
|
|
BUILD_BYPRODUCTS ${ONEDNN_OUTPUT_LIBRARY}
|
|
|
|
|
)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
build_onednn_gpu()
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
2021-06-23 09:53:18 +03:00
|
|
|
# Install
|
2021-06-22 17:39:39 +03:00
|
|
|
#
|
|
|
|
|
|
2021-06-23 09:53:18 +03:00
|
|
|
ie_cpack_add_component(cpp_samples_deps)
|
|
|
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gflags
|
2021-09-15 16:49:11 +03:00
|
|
|
DESTINATION "samples/cpp/thirdparty"
|
2021-06-23 09:53:18 +03:00
|
|
|
COMPONENT cpp_samples_deps
|
|
|
|
|
USE_SOURCE_PERMISSIONS)
|
|
|
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/zlib
|
2021-09-15 16:49:11 +03:00
|
|
|
DESTINATION "samples/cpp/thirdparty"
|
2021-06-23 09:53:18 +03:00
|
|
|
COMPONENT cpp_samples_deps
|
|
|
|
|
USE_SOURCE_PERMISSIONS)
|
|
|
|
|
|
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cnpy
|
2021-09-15 16:49:11 +03:00
|
|
|
DESTINATION "samples/cpp/thirdparty"
|
2021-06-23 09:53:18 +03:00
|
|
|
COMPONENT cpp_samples_deps
|
|
|
|
|
USE_SOURCE_PERMISSIONS)
|