* Infrastructure for tflite * Removed submodule flatbuffers * Added flatbuffers submodule. Fixed version to v22.12.06 aka acf39ff * Move headers back * Flatbuffers integration * Small fixes * Started parsing the Model * flatbuffer changes * decoder_flatbuffer changes * Lite Input Model -- not needed as of now but looks cool * Rolled back inherritance from ov::frontend::tensorflow::InputModel * Results are not treated as outputs, but its ok * Fix missplaced input vs output * Refactor * Load model op-by-op. Frontend API finalized * Debugging still, there are prints here and there. Decoder is not sane * Convolution with all attributes is translated and quantization is applied for inputs and constatants. TODO: quantize intermediate tensors, separate decoder specific logic? * Float ssd and posenet models are showing good accuracy * Need to refactor but work flawlessly * Telemetry and lightweight model cutting * Code style and test changes. Extensions supported * Quantization and style * Style refinements * Move onednn back * New portion of operations enabled * TFLite FE doesn't inherrit TF FE * Moved files to another directory * Rename header op_table.hpp to common_op_table.hpp for all files in src/frontends/tensorflow_common/src/op/ * Removed visability macroses * CMake changes * Unit-test execution in .ci * Update labeler.yml * Codeowners * Style check and fix * Static Build arrangement * Addressing the comments * install common headers to previous place * New approach with public decoder and graph_iterator * New approach with public decoder and graph_iterator * Move GraphIterator back * Comments addressed * Comments adressed * Preliminary TF FE README.md changes * Added target_compile_definitions OPENVINO_STATIC_LIBRARY for static build * Fixed conflicts and added TF to common places * Frontends use only openvino::core::dev API * Merged common tensorflow changes and made code build and work on selective number of models * Style * Rollback unnecessary changes from Tensorflow FE * Rollback unnecessary changes from Tensorflow Common * Minor refactor * cmake minor refactoring * Mixed commit * Style and merge fix * Low hanging fruit operations * Fix windows build * Refactor quantization parameters representation * license compliance. approved by OS PDT * copyrights in generic file * dependabot * labeler * Unit Test to be triggered in CI * cmake variables naming. corrected copyright years in copyrights/generic file * library renamed in .ci/ calls * Copyright year update * Set openvino-tf-frontend-maintainers as owner of /src/frontends/tensorflow_lite/ * Fixed flatc corss-compilation * Cleaned flatbuffers header usage * Nitpicks solved * Update cmake/templates/OpenVINOConfig.cmake.in * Compile with flatbuffers headers * Fixed "which is prefixed in the source directory" * Fixed typo in flatbuffers cmake * Removed flatbuffers submodule * Added fork submodule * Fixed static build * Fixed cross-compilatio * Fixed -Wshadow warning * Fixed warning on Windows * Use only headers from flatbuffers library * Added LTO and fixed compilation errors on Windows * Fixed warnings in tensorflow_common * Move ctors implementation to cpp file * Added information about new frontends to common FEm part * Temporaryily disable warnings * Fixed code style using clang-format * Fixed Windows * reverted changes in onnx * Revert changes in onnx_common * Removed pragma once frm cpp Co-authored-by: missjane <estepyreva@gmail.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
101 lines
3.9 KiB
CMake
101 lines
3.9 KiB
CMake
# Copyright (C) 2018-2023 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
include(ExternalProject)
|
|
|
|
#
|
|
# ov_native_compile_external_project(
|
|
# TARGET_NAME <name>
|
|
# NATIVE_INSTALL_DIR <source dir>
|
|
# NATIVE_TARGETS <target1 target2 ..>
|
|
# [NATIVE_SOURCE_SUBDIR <subdir>]
|
|
# [CMAKE_ARGS <option1 option2 ...>]
|
|
# )
|
|
#
|
|
function(ov_native_compile_external_project)
|
|
set(oneValueRequiredArgs NATIVE_INSTALL_DIR TARGET_NAME NATIVE_SOURCE_SUBDIR)
|
|
set(multiValueArgs CMAKE_ARGS NATIVE_TARGETS)
|
|
cmake_parse_arguments(ARG "" "${oneValueRequiredArgs};${oneValueOptionalArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
if(YOCTO_AARCH64)
|
|
# need to unset several variables which can set env to cross-environment
|
|
foreach(var SDKTARGETSYSROOT CONFIG_SITE OECORE_NATIVE_SYSROOT OECORE_TARGET_SYSROOT
|
|
OECORE_ACLOCAL_OPTS OECORE_BASELIB OECORE_TARGET_ARCH OECORE_TARGET_OS CC CXX
|
|
CPP AS LD GDB STRIP RANLIB OBJCOPY OBJDUMP READELF AR NM M4 TARGET_PREFIX
|
|
CONFIGURE_FLAGS CFLAGS CXXFLAGS LDFLAGS CPPFLAGS KCFLAGS OECORE_DISTRO_VERSION
|
|
OECORE_SDK_VERSION ARCH CROSS_COMPILE OE_CMAKE_TOOLCHAIN_FILE OPENSSL_CONF
|
|
OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH)
|
|
if(DEFINED ENV{${var}})
|
|
list(APPEND cmake_env --unset=${var})
|
|
endif()
|
|
endforeach()
|
|
|
|
# filter out PATH from yocto locations
|
|
string(REPLACE ":" ";" custom_path "$ENV{PATH}")
|
|
foreach(path IN LISTS custom_path)
|
|
if(NOT path MATCHES "^$ENV{OECORE_NATIVE_SYSROOT}")
|
|
list(APPEND clean_path "${path}")
|
|
endif()
|
|
endforeach()
|
|
|
|
find_host_program(NATIVE_CMAKE_COMMAND
|
|
NAMES cmake
|
|
PATHS ${clean_path}
|
|
DOC "Host cmake"
|
|
REQUIRED
|
|
NO_DEFAULT_PATH)
|
|
else()
|
|
set(NATIVE_CMAKE_COMMAND "${CMAKE_COMMAND}")
|
|
endif()
|
|
|
|
# if env has CMAKE_TOOLCHAIN_FILE, we need to skip it
|
|
if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
|
|
list(APPEND cmake_env --unset=CMAKE_TOOLCHAIN_FILE)
|
|
endif()
|
|
|
|
# compile flags
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
set(compile_flags "-Wno-undef -Wno-error -Wno-deprecated-declarations")
|
|
endif()
|
|
|
|
if(ARG_NATIVE_SOURCE_SUBDIR)
|
|
set(ARG_NATIVE_SOURCE_SUBDIR SOURCE_SUBDIR ${ARG_NATIVE_SOURCE_SUBDIR})
|
|
endif()
|
|
|
|
ExternalProject_Add(${ARG_TARGET_NAME}
|
|
# Directory Options
|
|
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
|
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/build"
|
|
INSTALL_DIR "${ARG_NATIVE_INSTALL_DIR}"
|
|
# Configure Step Options:
|
|
CMAKE_COMMAND
|
|
${NATIVE_CMAKE_COMMAND}
|
|
CMAKE_ARGS
|
|
"-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}"
|
|
"-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}"
|
|
"-DCMAKE_CXX_LINKER_LAUNCHER=${CMAKE_CXX_LINKER_LAUNCHER}"
|
|
"-DCMAKE_C_LINKER_LAUNCHER=${CMAKE_C_LINKER_LAUNCHER}"
|
|
"-DCMAKE_CXX_FLAGS=${compile_flags}"
|
|
"-DCMAKE_C_FLAGS=${compile_flags}"
|
|
"-DCMAKE_POLICY_DEFAULT_CMP0069=NEW"
|
|
"-DCMAKE_INSTALL_PREFIX=${ARG_NATIVE_INSTALL_DIR}"
|
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
|
|
${ARG_CMAKE_ARGS}
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
${ARG_NATIVE_SOURCE_SUBDIR}
|
|
# Build Step Options:
|
|
BUILD_COMMAND
|
|
${NATIVE_CMAKE_COMMAND}
|
|
--build "${CMAKE_CURRENT_BINARY_DIR}/build"
|
|
--config Release
|
|
--parallel
|
|
-- ${ARG_NATIVE_TARGETS}
|
|
# Test Step Options:
|
|
TEST_EXCLUDE_FROM_MAIN ON
|
|
# Target Options:
|
|
EXCLUDE_FROM_ALL ON
|
|
)
|
|
endfunction()
|