Replaced several cmake utilities with new ov_ prefix (#19819)

* Replaced several cmake utilities with new ov_ prefix

* Replaced several cmake utilities with new ov_ prefix
This commit is contained in:
Ilya Lavrenov 2023-09-14 16:22:50 +04:00 committed by GitHub
parent d6ef6e253c
commit 35a0706dff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
124 changed files with 433 additions and 365 deletions

View File

@ -120,7 +120,7 @@ function(addIeTarget)
endif()
if (ARG_ADD_CLANG_FORMAT)
# code style
add_clang_format_target(${ARG_NAME}_clang FOR_TARGETS ${ARG_NAME})
ov_add_clang_format_target(${ARG_NAME}_clang FOR_TARGETS ${ARG_NAME})
endif()
if (ARG_DEVELOPER_PACKAGE)
# developer package

View File

@ -193,6 +193,11 @@ endfunction()
#
# ie_add_api_validator_post_build_step(TARGET <name>)
#
macro(ie_add_api_validator_post_build_step)
macro(ov_add_api_validator_post_build_step)
_ov_add_api_validator_post_build_step(${ARGV})
endmacro()
macro(ie_add_api_validator_post_build_step)
message(WARNING "ie_add_api_validator_post_build_step is deprecated, use ov_add_api_validator_post_build_step instead")
_ov_add_api_validator_post_build_step(${ARGV})
endmacro()

View File

@ -32,10 +32,10 @@ if(ENABLE_CLANG_FORMAT AND NOT TARGET clang_format_check_all)
endif()
#
# add_clang_format_target(FOR_TARGETS <target1 target2 ...> | FOR_SOURCES <source1 source2 ...>
# [EXCLUDE_PATTERNS <pattern1 pattern2 ...>])
# ov_add_clang_format_target(FOR_TARGETS <target1 target2 ...> | FOR_SOURCES <source1 source2 ...>
# [EXCLUDE_PATTERNS <pattern1 pattern2 ...>])
#
function(add_clang_format_target TARGET_NAME)
function(ov_add_clang_format_target TARGET_NAME)
if(NOT ENABLE_CLANG_FORMAT)
return()
endif()
@ -130,3 +130,8 @@ function(add_clang_format_target TARGET_NAME)
add_dependencies(clang_format_check_all ${TARGET_NAME})
add_dependencies(clang_format_fix_all ${TARGET_NAME}_fix)
endfunction()
function(add_clang_format_target)
message(WARNING "add_clang_format_target is deprecated, use ov_add_clang_format_target instead")
ov_add_clang_format_target(${ARGV})
endfunction()

View File

@ -218,24 +218,26 @@ endfunction()
# Enables Link Time Optimization compilation
#
macro(ie_enable_lto)
message(WARNING "ie_add_compiler_flags is deprecated, set INTERPROCEDURAL_OPTIMIZATION_RELEASE target property instead")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
endmacro()
#
# ie_add_compiler_flags(<flag1 [flag2 flag3 ...>])
# ov_add_compiler_flags(<flag1 [flag2 flag3 ...>])
#
# Adds compiler flags to C / C++ sources
#
macro(ie_add_compiler_flags)
macro(ov_add_compiler_flags)
foreach(flag ${ARGN})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
endforeach()
endmacro()
function(ov_add_compiler_flags)
ie_add_compiler_flags(${ARGN})
endfunction()
macro(ie_add_compiler_flags)
message(WARNING "ie_add_compiler_flags is deprecated, use ov_add_compiler_flags instead")
ov_add_compiler_flags(${ARGN})
endmacro()
#
# ov_force_include(<target> <PUBLIC | PRIVATE | INTERFACE> <header file>)
@ -267,11 +269,11 @@ function(ov_abi_free_target target)
endfunction()
#
# ie_python_minimal_api(<target>)
# ov_python_minimal_api(<target>)
#
# Set options to use only Python Limited API
#
function(ie_python_minimal_api target)
function(ov_python_minimal_api target)
# pybind11 uses a lot of API which is not a part of minimal python API subset
# Ref 1: https://docs.python.org/3.11/c-api/stable.html
# Ref 2: https://github.com/pybind/pybind11/issues/1755
@ -301,7 +303,7 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
endif()
if(ENABLE_COVERAGE)
ie_add_compiler_flags(--coverage)
ov_add_compiler_flags(--coverage)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif()
@ -313,9 +315,9 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
if(CMAKE_CL_64)
# Default char Type Is unsigned
# ie_add_compiler_flags(/J)
# ov_add_compiler_flags(/J)
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-fsigned-char)
ov_add_compiler_flags(-fsigned-char)
endif()
file(RELATIVE_PATH OV_RELATIVE_BIN_PATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
@ -335,22 +337,22 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Common options / warnings enabled
#
ie_add_compiler_flags(/D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS)
ov_add_compiler_flags(/D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS)
# no asynchronous structured exception handling
ie_add_compiler_flags(/EHsc)
ov_add_compiler_flags(/EHsc)
# Allows the compiler to package individual functions in the form of packaged functions (COMDATs).
ie_add_compiler_flags(/Gy)
ov_add_compiler_flags(/Gy)
# This option helps ensure the fewest possible hard-to-find code defects. Similar to -Wall on GNU / Clang
ie_add_compiler_flags(/W3)
ov_add_compiler_flags(/W3)
# Increase Number of Sections in .Obj file
ie_add_compiler_flags(/bigobj)
ov_add_compiler_flags(/bigobj)
# Build with multiple processes
ie_add_compiler_flags(/MP)
ov_add_compiler_flags(/MP)
if(AARCH64 AND NOT MSVC_VERSION LESS 1930)
# otherwise, _ARM64_EXTENDED_INTRINSICS is defined, which defines 'mvn' macro
ie_add_compiler_flags(/D_ARM64_DISTINCT_NEON_TYPES)
ov_add_compiler_flags(/D_ARM64_DISTINCT_NEON_TYPES)
endif()
# Handle Large Addresses
@ -362,7 +364,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_COMPILE_WARNING_AS_ERROR)
if(CMAKE_VERSION VERSION_LESS 3.24)
ie_add_compiler_flags(/WX)
ov_add_compiler_flags(/WX)
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /WX")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /WX")
@ -374,9 +376,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
#
# C4251 needs to have dll-interface to be used by clients of class
ie_add_compiler_flags(/wd4251)
ov_add_compiler_flags(/wd4251)
# C4275 non dll-interface class used as base for dll-interface class
ie_add_compiler_flags(/wd4275)
ov_add_compiler_flags(/wd4275)
# Enable __FILE__ trim, use path with forward and backward slash as directory separator
add_compile_options(
@ -400,7 +402,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND WIN32)
#
if(CMAKE_COMPILE_WARNING_AS_ERROR AND CMAKE_VERSION VERSION_LESS 3.24)
ie_add_compiler_flags(/Qdiag-warning:47,1740,1786)
ov_add_compiler_flags(/Qdiag-warning:47,1740,1786)
endif()
#
@ -408,40 +410,40 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND WIN32)
#
# 161: unrecognized pragma
ie_add_compiler_flags(/Qdiag-disable:161)
ov_add_compiler_flags(/Qdiag-disable:161)
# 177: variable was declared but never referenced
ie_add_compiler_flags(/Qdiag-disable:177)
ov_add_compiler_flags(/Qdiag-disable:177)
# 556: not matched type of assigned function pointer
ie_add_compiler_flags(/Qdiag-disable:556)
ov_add_compiler_flags(/Qdiag-disable:556)
# 1744: field of class type without a DLL interface used in a class with a DLL interface
ie_add_compiler_flags(/Qdiag-disable:1744)
ov_add_compiler_flags(/Qdiag-disable:1744)
# 1879: unimplemented pragma ignored
ie_add_compiler_flags(/Qdiag-disable:1879)
ov_add_compiler_flags(/Qdiag-disable:1879)
# 2586: decorated name length exceeded, name was truncated
ie_add_compiler_flags(/Qdiag-disable:2586)
ov_add_compiler_flags(/Qdiag-disable:2586)
# 2651: attribute does not apply to any entity
ie_add_compiler_flags(/Qdiag-disable:2651)
ov_add_compiler_flags(/Qdiag-disable:2651)
# 3180: unrecognized OpenMP pragma
ie_add_compiler_flags(/Qdiag-disable:3180)
ov_add_compiler_flags(/Qdiag-disable:3180)
# 11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
ie_add_compiler_flags(/Qdiag-disable:11075)
ov_add_compiler_flags(/Qdiag-disable:11075)
# 15335: was not vectorized: vectorization possible but seems inefficient.
# Use vector always directive or /Qvec-threshold0 to override
ie_add_compiler_flags(/Qdiag-disable:15335)
ov_add_compiler_flags(/Qdiag-disable:15335)
else()
#
# Common enabled warnings
#
# allow linker eliminating the unused code and data from the final executable
ie_add_compiler_flags(-ffunction-sections -fdata-sections)
ov_add_compiler_flags(-ffunction-sections -fdata-sections)
# emits text showing the command-line option controlling a diagnostic
ie_add_compiler_flags(-fdiagnostics-show-option)
ov_add_compiler_flags(-fdiagnostics-show-option)
# This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid
ie_add_compiler_flags(-Wall)
ov_add_compiler_flags(-Wall)
# Warn if an undefined identifier is evaluated in an #if directive. Such identifiers are replaced with zero.
ie_add_compiler_flags(-Wundef)
ov_add_compiler_flags(-Wundef)
# To guarantee OpenVINO can be used with gcc versions 7 through 12
# - https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html
@ -468,7 +470,7 @@ else()
#
if(CMAKE_COMPILE_WARNING_AS_ERROR AND CMAKE_VERSION VERSION_LESS 3.24)
ie_add_compiler_flags(-Werror)
ov_add_compiler_flags(-Werror)
endif()
#
@ -477,7 +479,7 @@ else()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# 177: function "XXX" was declared but never referenced
ie_add_compiler_flags(-diag-disable=remark,177,2196)
ov_add_compiler_flags(-diag-disable=remark,177,2196)
endif()
#
@ -493,8 +495,8 @@ else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ERROR_ON_MISSING_LIBRARIES=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
ie_add_compiler_flags(-sDISABLE_EXCEPTION_CATCHING=0)
# ie_add_compiler_flags(-sUSE_PTHREADS=1)
ov_add_compiler_flags(-sDISABLE_EXCEPTION_CATCHING=0)
# ov_add_compiler_flags(-sUSE_PTHREADS=1)
else()
set(exclude_libs "-Wl,--exclude-libs,ALL")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections ${exclude_libs}")
@ -507,7 +509,6 @@ else()
endif()
add_compile_definitions(
# Defines to trim check of __FILE__ macro in case if not done by compiler.
OV_NATIVE_PARENT_PROJECT_ROOT_DIR="${OV_NATIVE_PARENT_PROJECT_ROOT_DIR}")
@ -519,11 +520,11 @@ endif()
check_cxx_compiler_flag("-Wunused-but-set-variable" UNUSED_BUT_SET_VARIABLE_SUPPORTED)
#
# link_system_libraries(target <PUBLIC | PRIVATE | INTERFACE> <lib1 [lib2 lib3 ...]>)
# ov_link_system_libraries(target <PUBLIC | PRIVATE | INTERFACE> <lib1 [lib2 lib3 ...]>)
#
# Links provided libraries and include their INTERFACE_INCLUDE_DIRECTORIES as SYSTEM
#
function(link_system_libraries TARGET_NAME)
function(ov_link_system_libraries TARGET_NAME)
set(MODE PRIVATE)
foreach(arg IN LISTS ARGN)

View File

@ -4,23 +4,23 @@
include(CMakeParseArguments)
function(ie_faster_build TARGET_NAME)
function(ov_build_target_faster TARGET_NAME)
if(NOT ENABLE_FASTER_BUILD)
return()
endif()
cmake_parse_arguments(IE_FASTER_BUILD "UNITY" "" "PCH" ${ARGN})
cmake_parse_arguments(FASTER_BUILD "UNITY" "" "PCH" ${ARGN})
if(IE_FASTER_BUILD_UNITY)
set_target_properties(${TARGET_NAME}
PROPERTIES
UNITY_BUILD ON
)
if(FASTER_BUILD_UNITY)
set_target_properties(${TARGET_NAME} PROPERTIES UNITY_BUILD ON)
endif()
if(IE_FASTER_BUILD_PCH)
target_precompile_headers(${TARGET_NAME}
${IE_FASTER_BUILD_PCH}
)
if(FASTER_BUILD_PCH)
target_precompile_headers(${TARGET_NAME} ${FASTER_BUILD_PCH})
endif()
endfunction()
function(ie_faster_build)
message(WARNING "ie_faster_build is deprecated, use ov_build_target_faster instead")
ov_build_target_faster(${ARGV})
endfunction()

View File

@ -183,6 +183,11 @@ macro(ov_add_frontend)
"-Dget_api_version=get_api_version_${OV_FRONTEND_NAME}")
endif()
# remove -Wmissing-declarations warning, because of frontends implementation specific
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
target_compile_options(${TARGET_NAME} PRIVATE -Wno-missing-declarations)
endif()
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${${TARGET_NAME}_INCLUDE_DIR}>
@ -219,7 +224,7 @@ macro(ov_add_frontend)
set(protobuf_target_name "protobuf::${protobuf_target_name}")
endif()
link_system_libraries(${TARGET_NAME} PRIVATE ${protobuf_target_name})
ov_link_system_libraries(${TARGET_NAME} PRIVATE ${protobuf_target_name})
# protobuf generated code emits -Wsuggest-override error
if(SUGGEST_OVERRIDE_SUPPORTED)
@ -242,8 +247,8 @@ macro(ov_add_frontend)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${flatbuffers_INCLUDE_DIRECTORIES})
endif()
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${proto_files} ${flatbuffers_schema_files})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${proto_files} ${flatbuffers_schema_files})
# enable LTO
set_target_properties(${TARGET_NAME} PROPERTIES
@ -263,7 +268,7 @@ macro(ov_add_frontend)
add_dependencies(ov_frontends ${TARGET_NAME})
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
# since frontends are user-facing component which can be linked against,
# then we need to mark it to be CXX ABI free

View File

@ -103,7 +103,7 @@ function(ov_add_plugin)
endforeach()
if (OV_PLUGIN_ADD_CLANG_FORMAT)
add_clang_format_target(${OV_PLUGIN_NAME}_clang FOR_SOURCES ${OV_PLUGIN_SOURCES})
ov_add_clang_format_target(${OV_PLUGIN_NAME}_clang FOR_SOURCES ${OV_PLUGIN_SOURCES})
else()
add_cpplint_target(${OV_PLUGIN_NAME}_cpplint FOR_TARGETS ${OV_PLUGIN_NAME} CUSTOM_FILTERS ${custom_filter})
endif()

View File

@ -134,8 +134,8 @@ endif()\n")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# 'argument': conversion from 'size_t' to 'int', possible loss of data
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4244)
endif()
# add each extra module

View File

@ -5,14 +5,14 @@
set(TARGET_NAME ie_docs_snippets)
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wall)
ov_add_compiler_flags(-Wall)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-unused-variable)
ov_add_compiler_flags(-Wno-unused-variable)
endif()
if(UNUSED_BUT_SET_VARIABLE_SUPPORTED)
ie_add_compiler_flags(-Wno-unused-but-set-variable)
ov_add_compiler_flags(-Wno-unused-but-set-variable)
endif()
file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"

View File

@ -28,6 +28,6 @@ target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/in
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER c_samples)
if(COMMAND add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(COMMAND ov_add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
endif()

View File

@ -233,8 +233,8 @@ macro(ie_add_sample)
endif()
add_dependencies(ie_samples ${IE_SAMPLE_NAME})
if(COMMAND add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
add_clang_format_target(${IE_SAMPLE_NAME}_clang FOR_SOURCES ${IE_SAMPLE_SOURCES} ${IE_SAMPLE_HEADERS})
if(COMMAND ov_add_clang_format_target AND NOT IE_SAMPLE_EXCLUDE_CLANG_FORMAT)
ov_add_clang_format_target(${IE_SAMPLE_NAME}_clang FOR_SOURCES ${IE_SAMPLE_SOURCES} ${IE_SAMPLE_HEADERS})
endif()
if(COMMAND ov_ncc_naming_style AND NOT c_sample)
ov_ncc_naming_style(FOR_TARGET "${IE_SAMPLE_NAME}"

View File

@ -35,6 +35,6 @@ target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/in
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER cpp_samples)
if(COMMAND add_clang_format_target)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(COMMAND ov_add_clang_format_target)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
endif()

View File

@ -17,6 +17,6 @@ find_package(OpenVINO REQUIRED COMPONENTS Runtime)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime PRIVATE ${GFLAGS_TARGET})
if(COMMAND add_clang_format_target)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(COMMAND ov_add_clang_format_target)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
endif()

View File

@ -4,20 +4,16 @@
add_definitions(-DIN_OV_COMPONENT)
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ov_add_compiler_flags(-Wmissing-declarations)
endif()
include(cmake/install_tbb.cmake)
# CC library should be registered before other cc targets
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(frontends)
# TODO: remove ngraph/ngraph.hpp usage
if(ENABLE_TESTS)
add_subdirectory(core/tests)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wmissing-declarations)
endif()
add_subdirectory(plugins)
add_subdirectory(inference)
@ -27,5 +23,6 @@ add_subdirectory(common/preprocessing)
add_subdirectory(bindings)
if(ENABLE_TESTS)
add_subdirectory(core/tests)
add_subdirectory(tests)
endif()

View File

@ -24,7 +24,7 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME} PUBLIC OPENVINO_STATIC_LIBRARY)
endif()
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

View File

@ -45,7 +45,7 @@ endif()
add_dependencies(${TARGET_NAME} mock_engine)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests

View File

@ -19,18 +19,18 @@ set_source_files_properties(${PYX_SOURCES} PROPERTIES CYTHON_IS_CXX ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# 'argument': conversion from 'size_t' to 'int', possible loss of data
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4244)
ie_add_compiler_flags(/wd4551)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4551)
endif()
if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-undef)
ov_add_compiler_flags(-Wno-undef)
if(OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-parentheses-equality)
ov_add_compiler_flags(-Wno-parentheses-equality)
endif()
endif()
if(UNUSED_BUT_SET_VARIABLE_SUPPORTED)
ie_add_compiler_flags(-Wno-unused-but-set-variable)
ov_add_compiler_flags(-Wno-unused-but-set-variable)
endif()
# create target
@ -50,7 +50,7 @@ foreach(PYX_FILE IN LISTS PYX_SOURCES)
target_include_directories(${PYX_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(${PYX_NAME} PRIVATE openvino::runtime)
list(APPEND INSTALLED_TARGETS ${PYX_NAME})
ie_python_minimal_api(${PYX_NAME})
ov_python_minimal_api(${PYX_NAME})
set_target_properties(${PYX_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
endforeach()
@ -68,7 +68,7 @@ function(python_ov_disable_deprecated_warnings)
endfunction()
python_ov_disable_deprecated_warnings()
ie_python_minimal_api(${TARGET_NAME})
ov_python_minimal_api(${TARGET_NAME})
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime)
@ -97,5 +97,5 @@ install(PROGRAMS __init__.py
COMPONENT ${PYTHON_COMPONENT}
${OV_CPACK_COMP_PYTHON_OPENVINO_EXCLUDE_ALL})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ".*\\.cxx;.*\\.pxd;.*\\.pyx")
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ".*\\.cxx;.*\\.pxd;.*\\.pyx")

View File

@ -71,8 +71,8 @@ endif()
# Install
if(OpenVINO_SOURCE_DIR OR OpenVINODeveloperPackage_FOUND)
ie_python_minimal_api(_${PROJECT_NAME})
add_clang_format_target(_${PROJECT_NAME}_clang FOR_TARGETS _${PROJECT_NAME})
ov_python_minimal_api(_${PROJECT_NAME})
ov_add_clang_format_target(_${PROJECT_NAME}_clang FOR_TARGETS _${PROJECT_NAME})
ov_cpack_add_component(${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion} HIDDEN)

View File

@ -105,8 +105,8 @@ if(OpenVINO_SOURCE_DIR)
endif()
if(OpenVINO_SOURCE_DIR OR OpenVINODeveloperPackage_FOUND)
ie_python_minimal_api(${PROJECT_NAME})
add_clang_format_target(${PROJECT_NAME}_clang FOR_TARGETS ${PROJECT_NAME})
ov_python_minimal_api(${PROJECT_NAME})
ov_add_clang_format_target(${PROJECT_NAME}_clang FOR_TARGETS ${PROJECT_NAME})
ov_cpack_add_component(${OV_CPACK_COMP_PYTHON_OPENVINO}_${pyversion}
HIDDEN)

View File

@ -42,8 +42,8 @@ add_custom_command(TARGET ${TARGET_NAME}
COMMAND ${CMAKE_COMMAND} -E copy ${OpenVINOPython_SOURCE_DIR}/src/openvino/test_utils/__init__.py ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/__init__.py
)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ".*\\.cxx")
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}
EXCLUDE_PATTERNS ".*\\.cxx")
# install

View File

@ -32,7 +32,7 @@ target_link_libraries(${TARGET_NAME} PUBLIC
$<$<BOOL:${ENABLE_OV_PADDLE_FRONTEND}>:openvino::frontend::paddle>)
ov_add_library_version(${TARGET_NAME})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL

View File

@ -12,6 +12,6 @@ pybind11_add_module(${PYBIND_FE_NAME} MODULE NO_EXTRAS ${PYBIND_FE_SRC})
target_link_libraries(${PYBIND_FE_NAME} PRIVATE openvino::frontend::mock_py)
add_clang_format_target(${PYBIND_FE_NAME}_clang FOR_TARGETS ${PYBIND_FE_NAME})
ov_add_clang_format_target(${PYBIND_FE_NAME}_clang FOR_TARGETS ${PYBIND_FE_NAME})
install(TARGETS ${PYBIND_FE_NAME} DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -68,7 +68,7 @@ ov_set_threading_interface_for(${TARGET_NAME})
ov_mark_target_as_cc(${TARGET_NAME})
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME} EXTRA ${TBB_IMPORTED_TARGETS})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME} EXTRA ${TBB_IMPORTED_TARGETS})
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

View File

@ -53,7 +53,7 @@ endif()
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
file(GLOB_RECURSE hdrs ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${hdrs})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${hdrs})
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::conditional_compilation)
if(ENABLE_TESTS)

View File

@ -38,5 +38,5 @@ target_include_directories(${TARGET_NAME} PUBLIC
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::itt)

View File

@ -23,7 +23,7 @@ add_library(${TARGET_NAME}_obj OBJECT
target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_OPENVINO_API)
ie_faster_build(${TARGET_NAME}_obj UNITY)
ov_build_target_faster(${TARGET_NAME}_obj UNITY)
target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt)

View File

@ -51,8 +51,9 @@ bool FakeQuantizeTransformation::transform(TransformationContext& context, ov::p
}
namespace fq {
namespace {
static std::shared_ptr<Node> updateShape(std::shared_ptr<Node> constantOp, const PartialShape& targetShape) {
std::shared_ptr<Node> updateShape(std::shared_ptr<Node> constantOp, const PartialShape& targetShape) {
assert(constantOp->get_output_partial_shape(0).is_static());
const Shape shape = constantOp->get_output_shape(0);
@ -64,7 +65,7 @@ static std::shared_ptr<Node> updateShape(std::shared_ptr<Node> constantOp, const
return constantOp;
}
static std::shared_ptr<Node> getDataNode(const std::shared_ptr<Node>& eltwise) {
std::shared_ptr<Node> getDataNode(const std::shared_ptr<Node>& eltwise) {
if (!ov::is_type<opset1::Constant>(eltwise->get_input_node_shared_ptr(0))) {
return eltwise->get_input_node_shared_ptr(0);
}
@ -76,7 +77,7 @@ static std::shared_ptr<Node> getDataNode(const std::shared_ptr<Node>& eltwise) {
return nullptr;
}
static std::shared_ptr<opset1::Constant> getConstant(const std::shared_ptr<Node>& eltwise) {
std::shared_ptr<opset1::Constant> getConstant(const std::shared_ptr<Node>& eltwise) {
if (eltwise->get_input_size() != 2) {
return nullptr;
}
@ -124,6 +125,7 @@ bool all_precisions_equal(const std::shared_ptr<Node>& node) {
return true;
}
} // namespace
} // namespace fq
bool FakeQuantizeTransformation::checkElementwise(const std::shared_ptr<Node>& eltwise) {

View File

@ -21,6 +21,8 @@ namespace ov {
namespace pass {
namespace low_precision {
namespace {
std::shared_ptr<opset1::Constant> gatherDeqConstant(
const std::shared_ptr<ov::Node> &gather,
const std::shared_ptr<ov::Node> &dequantizationConstant) {
@ -81,6 +83,8 @@ std::shared_ptr<opset1::Constant> gatherDeqConstant(
return constant;
}
} // namespace
GatherTransformation::GatherTransformation(const Params& params) : LayerTransformation(params) {
MATCHER_SCOPE(GatherTransformation);
auto gather = pattern::wrap_type<opset1::Gather, opset7::Gather, opset8::Gather>({ pattern::wrap_type<opset1::Multiply>(),

View File

@ -30,7 +30,7 @@ target_include_directories(${TARGET_NAME} PUBLIC ${PUBLIC_HEADERS_DIR}
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
# developer package

View File

@ -96,7 +96,7 @@ if(ENABLE_GAPI_PREPROCESSING)
add_library(${TARGET_NAME}_obj OBJECT
${LIBRARY_SRC}
${LIBRARY_HEADERS})
ie_faster_build(${TARGET_NAME}_obj UNITY)
ov_build_target_faster(${TARGET_NAME}_obj UNITY)
target_compile_definitions(${TARGET_NAME}_obj PRIVATE
IMPLEMENT_INFERENCE_ENGINE_PLUGIN
@ -166,7 +166,7 @@ if(ENABLE_GAPI_PREPROCESSING)
endif()
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_vs_version_file(NAME ${TARGET_NAME}
FILEDESCRIPTION "OpenVINO Preprocessing plugin")

View File

@ -24,7 +24,7 @@ add_library(${TARGET_NAME} STATIC
add_library(openvino::snippets ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME snippets)
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
)

View File

@ -22,7 +22,7 @@ addIeTargetTest(
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp"
)

View File

@ -20,7 +20,7 @@ source_group("include" FILES ${PUBLIC_HEADERS})
add_library(${TARGET_NAME}_obj OBJECT ${LIBRARY_SRC} ${PUBLIC_HEADERS})
target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_OPENVINO_API)
ie_faster_build(${TARGET_NAME}_obj
ov_build_target_faster(${TARGET_NAME}_obj
UNITY
PCH PRIVATE "src/precomp.hpp"
)
@ -30,7 +30,7 @@ target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::reference openvino::i
target_include_directories(${TARGET_NAME}_obj PRIVATE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
"${CMAKE_CURRENT_SOURCE_DIR}/src")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_mark_target_as_cc(${TARGET_NAME}_obj)

View File

@ -278,6 +278,8 @@ bool ov::batch_util::detach_detection_output(const std::shared_ptr<ov::Model>& f
return !new_outputs.empty() || !outputs_to_delete.empty();
}
namespace {
std::map<std::shared_ptr<ov::op::v0::Parameter>, ov::PartialShape> collect_original_input_shapes(
const std::shared_ptr<ov::Model>& m) {
const auto& parameters = m->get_parameters();
@ -291,6 +293,8 @@ std::map<std::shared_ptr<ov::op::v0::Parameter>, ov::PartialShape> collect_origi
return parameter_to_shape;
}
} // namespace
bool ov::pass::FindBatch::run_on_model(const std::shared_ptr<ov::Model>& m) {
RUN_ON_MODEL_SCOPE(FindBatch);
auto te = std::make_shared<ov::TableOfEquivalence>();

View File

@ -64,7 +64,7 @@ ov::pass::EliminateUnsqueezeGather::EliminateUnsqueezeGather() {
register_matcher(m, callback);
}
bool scalar_with_one_consumer(const Output<Node>& out) {
inline bool scalar_with_one_consumer(const Output<Node>& out) {
return rank_equals(0)(out) && consumers_count(1)(out);
}

View File

@ -264,6 +264,8 @@ bool ov::pass::GroupedStridedSliceOptimizer::run_on_model(const std::shared_ptr<
return graph_rewritten;
}
namespace {
struct SliceAttrs {
int64_t start, stop, axis;
};
@ -318,6 +320,8 @@ bool slice_is_suitable_for_optimization(const std::shared_ptr<ov::op::v8::Slice>
return true;
}
} // namespace
bool ov::pass::GroupedSliceToVSplitOptimization::run_on_model(const std::shared_ptr<ov::Model>& model) {
RUN_ON_FUNCTION_SCOPE(GroupedSliceToVSplitOptimization);
bool graph_rewritten = false;

View File

@ -689,6 +689,8 @@ bool fuse_type_to_nms9(const std::shared_ptr<ov::Node>& node, const precisions_m
return res;
}
namespace {
bool update_type(size_t idx,
const std::shared_ptr<ov::Node>& node,
const precisions_map& precisions,
@ -704,6 +706,8 @@ bool update_type(size_t idx,
return false;
}
} // namespace
bool fuse_type_to_matrix_nms(const std::shared_ptr<ov::Node>& node, const precisions_map& precisions) {
auto nms = ov::as_type_ptr<opset8::MatrixNms>(node);
if (!nms) {

View File

@ -52,6 +52,8 @@ using namespace std;
namespace ov {
namespace pass {
namespace {
void mark_reduceop_path(const std::shared_ptr<Node>& node) {
node->get_rt_info().emplace("reduceop_path", true);
}
@ -77,7 +79,7 @@ void erase_fq_path(const std::shared_ptr<Node>& node) {
}
// Marking continues to propagate through these ops.
std::shared_ptr<Node> propagate_through_ops =
const std::shared_ptr<Node> propagate_through_ops =
pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v1::Reshape,
@ -100,6 +102,8 @@ std::shared_ptr<Node> propagate_through_ops =
ov::op::v0::Constant,
ov::op::v0::Tile>();
} // namespace
/* After PropagateDownMark we need to go also once up to include side branches of ops with several args:
* Elementwise, Concat and so. E.g. if one of the argument of Concat was marked
* during PropagateDownMark we need also mark its other inputs and this is done in this PropagateUpMark pass.
@ -367,30 +371,30 @@ public:
MATCHER_SCOPE(PropagateDownDisableSensitivityForQuantized);
// through this nodes
std::shared_ptr<Node> quantization_propagating_nodes = pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v0::FakeQuantize,
ov::op::v1::Reshape,
op::util::BroadcastBase,
ov::op::v0::DepthToSpace,
ov::op::v0::Interpolate,
ov::op::v4::Interpolate,
ov::op::v11::Interpolate,
ov::op::v1::MaxPool,
ov::op::v8::MaxPool,
op::util::PadBase,
ov::op::v1::ReduceMax,
ov::op::v1::ReduceMin,
ov::op::v0::Relu,
ov::op::v1::Transpose,
ov::op::v0::ShuffleChannels,
ov::op::v1::StridedSlice,
ov::op::v8::Slice,
ov::op::v1::VariadicSplit,
ov::op::v1::Split,
op::util::GatherBase,
ov::op::v0::Concat,
ov::op::v0::Tile>();
const std::shared_ptr<Node> quantization_propagating_nodes = pattern::wrap_type<ov::op::v0::Squeeze,
ov::op::v0::Unsqueeze,
ov::op::v0::FakeQuantize,
ov::op::v1::Reshape,
op::util::BroadcastBase,
ov::op::v0::DepthToSpace,
ov::op::v0::Interpolate,
ov::op::v4::Interpolate,
ov::op::v11::Interpolate,
ov::op::v1::MaxPool,
ov::op::v8::MaxPool,
op::util::PadBase,
ov::op::v1::ReduceMax,
ov::op::v1::ReduceMin,
ov::op::v0::Relu,
ov::op::v1::Transpose,
ov::op::v0::ShuffleChannels,
ov::op::v1::StridedSlice,
ov::op::v8::Slice,
ov::op::v1::VariadicSplit,
ov::op::v1::Split,
op::util::GatherBase,
ov::op::v0::Concat,
ov::op::v0::Tile>();
matcher_pass_callback callback = [=](pattern::Matcher& m) {
const auto& node = m.get_match_root();

View File

@ -27,6 +27,8 @@
namespace ov {
namespace pass {
namespace {
/** \brief Check if output is rank one and data type can be i32 or i64. */
const auto is_rank_one_int_shape = [](const Output<Node>& output) -> bool {
return pattern::type_matches_any({element::i32, element::i64})(output) && pattern::has_static_shape()(output) &&
@ -109,6 +111,8 @@ std::shared_ptr<Node> make_eye_batches(NodeRegistry& reg, const Output<Node>& ey
return reg.make<ov::op::v0::Tile>(eye, batch_repeats);
}
} // namespace
EyeDecomposition::EyeDecomposition() {
MATCHER_SCOPE(EyeDecomposition);

View File

@ -22,6 +22,8 @@
using namespace std;
namespace {
ov::Input<ov::Node> get_outer_input_of_ti_by_parameter(const shared_ptr<ov::op::v0::Parameter>& parameter,
const shared_ptr<ov::op::v0::TensorIterator>& ti) {
int64_t parameter_index = ti->get_body()->get_parameter_index(parameter);
@ -154,6 +156,8 @@ bool relax_batch_for_initial_states_of_lstm(const shared_ptr<ov::op::v4::LSTMCel
return rewritten;
}
} // namespace
bool ov::pass::LSTMStatesBroadcast::run_on_model(const shared_ptr<ov::Model>& f) {
RUN_ON_FUNCTION_SCOPE(LSTMStatesBroadcast);
bool rewritten = false;

View File

@ -175,6 +175,9 @@ ov::Output<ov::Node> FixInputNodeRank(ov::Output<ov::Node> input_node,
} // namespace
namespace sink_forward {
namespace {
AxisVector AlignTransposeOrder(const Output<Node>& output, const TransposeInputsInfo& transpose_input_info) {
if (transpose_input_info.isEmpty()) {
return {};
@ -197,6 +200,8 @@ AxisVector AlignTransposeOrder(const Output<Node>& output, const TransposeInputs
return new_transpose_order;
}
} // namespace
bool UpdateInputTransposes(const NodePtr& main_node,
const TransposeInputsInfo& transpose_input_info,
std::vector<size_t> input_indexes) {

View File

@ -4,6 +4,10 @@
set(TARGET_NAME ov_transformations_tests)
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ov_add_compiler_flags(-Wno-missing-declarations)
endif()
ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -46,7 +46,7 @@ target_include_directories(${TARGET_NAME} PUBLIC
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
SOURCE_DIRECTORIES ${UTIL_INCLUDE_DIR})

View File

@ -9,10 +9,6 @@ add_definitions(-DIN_OV_CORE_LIBRARY)
set(OV_CORE_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wmissing-declarations)
endif()
file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp)
file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
@ -80,7 +76,7 @@ endif()
target_compile_definitions(ngraph_obj PRIVATE IMPLEMENT_OPENVINO_API)
ie_faster_build(ngraph_obj
ov_build_target_faster(ngraph_obj
UNITY
PCH PRIVATE "src/precomp.hpp")
@ -97,7 +93,7 @@ ov_abi_free_target(ngraph_obj)
ov_ncc_naming_style(FOR_TARGET ngraph_obj
SOURCE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include")
add_clang_format_target(ngraph_clang FOR_TARGETS ngraph_obj)
ov_add_clang_format_target(ngraph_clang FOR_TARGETS ngraph_obj)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(ngraph_obj PUBLIC OPENVINO_STATIC_LIBRARY)

View File

@ -21,7 +21,7 @@ add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
add_library(openvino::builders ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME builders)
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp")
@ -33,7 +33,7 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME} PUBLIC OPENVINO_STATIC_LIBRARY)
endif()
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_install_static_lib(openvino_builders ${OV_CPACK_COMP_CORE})

View File

@ -21,7 +21,7 @@ add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
add_library(openvino::reference ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME reference)
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
PCH PRIVATE "src/precomp.hpp")
@ -43,7 +43,7 @@ target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
find_package(Threads REQUIRED)
target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})

View File

@ -25,7 +25,7 @@ target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${SHAPE_INFER_INCLUDE_DIR}>
$<BUILD_INTERFACE:${OV_CORE_INCLUDE_PATH}>)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME} PUBLIC OPENVINO_STATIC_LIBRARY)

View File

@ -8,4 +8,4 @@ add_subdirectory(new)
# Enable code style check
file(GLOB_RECURSE template_extension_src "${CMAKE_CURRENT_SOURCE_DIR}/new/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/new/*.hpp")
add_clang_format_target(openvino_template_extension_clang FOR_SOURCES ${template_extension_src})
ov_add_clang_format_target(openvino_template_extension_clang FOR_SOURCES ${template_extension_src})

View File

@ -37,7 +37,7 @@ endif()
# Enable code style check
file(GLOB_RECURSE template_extension_src "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${template_extension_src})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${template_extension_src})
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -497,6 +497,7 @@ TEST_F(AnyTests, AnyRemovedRealObjectPointerWithDuplication) {
ASSERT_EQ(1, DestructorTest::destructorCount);
}
void PrintTo(const Any& object, std::ostream* stream);
void PrintTo(const Any& object, std::ostream* stream) {
if (object.empty() || !stream) {
return;

View File

@ -50,7 +50,8 @@ public:
}
};
::testing::AssertionResult test_ordered_ops(const std::shared_ptr<ov::Model>& m, const ov::NodeVector& required_ops) {
static ::testing::AssertionResult test_ordered_ops(const std::shared_ptr<ov::Model>& m,
const ov::NodeVector& required_ops) {
std::unordered_set<ov::Node*> seen;
for (auto& node_ptr : m->get_ordered_ops()) {
ov::Node* node = node_ptr.get();

View File

@ -15,7 +15,7 @@ target_include_directories(${MOCK1_FE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${MOCK1_FE_NAME} PRIVATE frontend_common)
add_dependencies(ov_core_unit_tests ${MOCK1_FE_NAME})
add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME})
ov_add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME})
install(TARGETS ${MOCK1_FE_NAME}
RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL

View File

@ -63,14 +63,14 @@ public:
Anchor() : GraphRewrite() {}
};
std::shared_ptr<Model> get_model() {
inline std::shared_ptr<Model> get_model() {
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto divide_constant = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1}, {1.5});
auto divide = std::make_shared<ov::op::v1::Divide>(data, divide_constant);
return std::make_shared<ov::Model>(ov::NodeVector{divide}, ov::ParameterVector{data});
}
ov::pass::param_callback get_callback() {
inline ov::pass::param_callback get_callback() {
return [](const std::shared_ptr<const Node>& node) -> bool {
if (std::dynamic_pointer_cast<const op::v1::Divide>(node)) {
return true;
@ -169,7 +169,7 @@ public:
using ov::op::v1::Divide::Divide;
};
std::shared_ptr<Model> get_derived_model() {
static std::shared_ptr<Model> get_derived_model() {
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto divide_constant = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1}, {1.5});
auto divide = std::make_shared<PrivateDivide>(data, divide_constant);

View File

@ -18,12 +18,14 @@
using namespace ov;
using namespace std;
static std::shared_ptr<op::v0::Constant> get_result_constant(std::shared_ptr<Model> m, size_t pos = 0) {
namespace {
std::shared_ptr<op::v0::Constant> get_result_constant(std::shared_ptr<Model> m, size_t pos = 0) {
return ov::as_type_ptr<op::v0::Constant>(m->get_results().at(pos)->input_value(0).get_node_shared_ptr());
}
template <typename T>
static std::vector<T> get_result_constant_data(std::shared_ptr<Model> m, size_t pos) {
std::vector<T> get_result_constant_data(std::shared_ptr<Model> m, size_t pos) {
auto new_const = get_result_constant(m, pos);
return new_const->cast_vector<T>();
}
@ -62,10 +64,10 @@ void run_constant_folding(std::shared_ptr<ov::Model>& model) {
pass_manager.run_passes(model);
}
static void check_names(const std::shared_ptr<ov::Node>& node,
const std::vector<std::string>& expected_fused_names,
const std::string expected_name = "test",
bool exact = true) {
void check_names(const std::shared_ptr<ov::Node>& node,
const std::vector<std::string>& expected_fused_names,
const std::string expected_name = "test",
bool exact = true) {
EXPECT_TRUE(node);
// Check node name
@ -102,6 +104,8 @@ static void check_names(const std::shared_ptr<ov::Node>& node,
}
}
} // namespace
TEST(constant_folding, acosh) {
Shape shape_in{2, 4, 1};
@ -848,7 +852,7 @@ TEST(constant_folding, shape_of_rank_dynamic_v3) {
check_names(result_shape_of, {"test"});
}
void const_reverse(const element::Type& axes_elem_type) {
static void const_reverse(const element::Type& axes_elem_type) {
Shape input_shape{3, 3};
vector<int32_t> values_in{1, 2, 3, 4, 5, 6, 7, 8, 9};
@ -3559,11 +3563,11 @@ TEST(constant_folding, constant_scatter_elements_update_one_elem) {
range_test_check(result_node->cast_vector<int32_t>(), expected);
}
void test_constant_folding_reshape_v1(Shape& shape_in,
vector<float>& values_in,
Shape shape_shape,
vector<int32_t> values_shape,
bool zero_flag = false) {
static void test_constant_folding_reshape_v1(Shape& shape_in,
vector<float>& values_in,
Shape shape_shape,
vector<int32_t> values_shape,
bool zero_flag = false) {
auto constant_in = make_shared<ov::op::v0::Constant>(element::f32, shape_in, values_in);
constant_in->set_friendly_name("constant_in");
auto constant_shape = make_shared<ov::op::v0::Constant>(element::i64, shape_shape, values_shape);
@ -3584,6 +3588,7 @@ void test_constant_folding_reshape_v1(Shape& shape_in,
ASSERT_TRUE(ov::test::utils::all_close_f(values_in, values_out, MIN_FLOAT_TOLERANCE_BITS));
}
TEST(constant_folding, constant_dyn_reshape_v1_2d) {
Shape shape_in{2, 5};
vector<float> values_in{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

View File

@ -73,7 +73,7 @@ public:
}
};
std::tuple<std::shared_ptr<Model>, std::shared_ptr<Node>, std::shared_ptr<Node>> get_test_function() {
static std::tuple<std::shared_ptr<Model>, std::shared_ptr<Node>, std::shared_ptr<Node>> get_test_function() {
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto relu = std::make_shared<ov::op::v0::Relu>(data);
relu->set_friendly_name("relu");

View File

@ -22,6 +22,8 @@
using namespace ov;
using namespace std;
namespace {
std::shared_ptr<ov::Model> make_test_graph() {
auto arg_0 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
auto arg_1 = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 2});
@ -73,6 +75,8 @@ bool validate_list(const std::vector<std::shared_ptr<ov::Node>>& nodes) {
return rc;
}
} // namespace
TEST(pass_manager, add) {
pass::Manager pass_manager;

View File

@ -20,7 +20,7 @@
using namespace ov;
using namespace std;
std::shared_ptr<ov::Model> create_complex_function(size_t wide = 50) {
static std::shared_ptr<ov::Model> create_complex_function(size_t wide = 50) {
const auto& split_subgraph = [](const ov::Output<ov::Node>& input) -> ov::OutputVector {
auto relu = std::make_shared<ov::opset8::Relu>(input);
auto type_relaxed =

View File

@ -25,7 +25,7 @@ struct augru_sequence_parameters {
element::Type et = element::f32;
};
shared_ptr<op::internal::AUGRUSequence> augru_seq_init(const augru_sequence_parameters& params) {
static shared_ptr<op::internal::AUGRUSequence> augru_seq_init(const augru_sequence_parameters& params) {
auto batch_size = params.batch_size;
auto seq_length = params.seq_length;
auto input_size = params.input_size;

View File

@ -31,8 +31,8 @@ using namespace testing;
//
// Tests for binary elementwise ops.
//
void test_binary(std::string /* node_type */,
shared_ptr<ov::Node>(f)(const shared_ptr<ov::Node>& x, const shared_ptr<ov::Node>& y)) {
static void test_binary(std::string /* node_type */,
shared_ptr<ov::Node>(f)(const shared_ptr<ov::Node>& x, const shared_ptr<ov::Node>& y)) {
// Check for bad arguments
auto tv0_2_4_param_0 = make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 4});
auto tv0_2_4_param_1 = make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{2, 4});

View File

@ -18,15 +18,16 @@ using namespace ov;
using namespace testing;
// ------------------------------ V0 ------------------------------
std::shared_ptr<op::v0::DetectionOutput> create_detection_output(PartialShape box_logits_shape,
PartialShape class_preds_shape,
PartialShape proposals_shape,
PartialShape aux_class_preds_shape,
PartialShape aux_box_preds_shape,
const ov::op::v0::DetectionOutput::Attributes& attrs,
element::Type input_type,
element::Type proposals_type,
bool set_labels = false) {
static std::shared_ptr<op::v0::DetectionOutput> create_detection_output(
PartialShape box_logits_shape,
PartialShape class_preds_shape,
PartialShape proposals_shape,
PartialShape aux_class_preds_shape,
PartialShape aux_box_preds_shape,
const ov::op::v0::DetectionOutput::Attributes& attrs,
element::Type input_type,
element::Type proposals_type,
bool set_labels = false) {
if (set_labels) {
// The labels are set for all of the shapes,
// but the output dimension is always a product of multiplication, so labels are not preserved
@ -325,12 +326,12 @@ TEST(type_prop_layers, detection_output_v0_dynamic_batch) {
EXPECT_EQ(op->get_element_type(), element::f32);
}
void detection_output_invalid_data_type_test(element::Type box_logits_et,
element::Type class_preds_et,
element::Type proposals_et,
element::Type aux_class_preds_et,
element::Type aux_box_preds_et,
const std::string& expected_msg) {
static void detection_output_invalid_data_type_test(element::Type box_logits_et,
element::Type class_preds_et,
element::Type proposals_et,
element::Type aux_class_preds_et,
element::Type aux_box_preds_et,
const std::string& expected_msg) {
try {
auto box_logits = make_shared<ov::op::v0::Parameter>(box_logits_et, Shape{4, 20});
auto class_preds = make_shared<ov::op::v0::Parameter>(class_preds_et, Shape{4, 10});

View File

@ -13,6 +13,8 @@
using namespace std;
using namespace ov;
namespace {
struct gru_sequence_parameters {
Dimension batch_size = 8;
Dimension num_directions = 1;
@ -80,6 +82,8 @@ shared_ptr<ov::op::v5::GRUSequence> gru_seq_direction_initialization(const gru_s
return gru_sequence;
}
} // namespace
TEST(type_prop, gru_sequence_forward) {
const size_t batch_size = 8;
const size_t num_directions = 1;

View File

@ -9,6 +9,8 @@
using namespace std;
using namespace ov;
namespace {
//
// RNN sequence parameters
//
@ -121,6 +123,8 @@ shared_ptr<opset1::LSTMSequence> lstm_seq_v0_tensor_initialization(const recurre
return lstm_sequence;
}
} // namespace
TEST(type_prop, lstm_sequence_forward) {
const size_t batch_size = 8;
const size_t num_directions = 1;

View File

@ -4,10 +4,6 @@
set(TARGET_NAME "frontend_common")
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wmissing-declarations)
endif()
file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp)
file(GLOB_RECURSE LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
@ -54,7 +50,7 @@ target_compile_definitions(${TARGET_NAME}_obj PRIVATE
FRONTEND_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}${FRONTEND_NAME_PREFIX}"
FRONTEND_LIB_SUFFIX="${FRONTEND_LIB_SUFFIX}")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
# FEM is public API => need to mark this library as important for ABI free
ov_abi_free_target(${TARGET_NAME}_obj)

View File

@ -20,7 +20,7 @@ public:
return m_op_type;
}
virtual ~ConversionExtensionBase();
~ConversionExtensionBase() override = default;
private:
std::string m_op_type;

View File

@ -5,6 +5,5 @@
#include "openvino/frontend/extension/conversion.hpp"
using namespace ov::frontend;
ConversionExtensionBase::~ConversionExtensionBase() = default;
ConversionExtension::~ConversionExtension() = default;

View File

@ -7,9 +7,9 @@
#include <memory>
#include <string>
#include "legacy_conversion_extension.hpp"
#include "ngraph/function.hpp"
#include "openvino/frontend/extension/holder.hpp"
#include "utils/legacy_conversion_extension.hpp"
#include "utils/tensor_external_data.hpp"
namespace ONNX_NAMESPACE {

View File

@ -19,9 +19,7 @@ namespace detail {
TensorExternalData::TensorExternalData(const ONNX_NAMESPACE::TensorProto& tensor) {
for (const auto& entry : tensor.external_data()) {
if (entry.key() == "location") {
NGRAPH_SUPPRESS_DEPRECATED_START
m_data_location = file_util::sanitize_path(entry.value());
NGRAPH_SUPPRESS_DEPRECATED_END
m_data_location = ov::util::sanitize_path(entry.value());
} else if (entry.key() == "offset") {
m_offset = std::stoull(entry.value());
} else if (entry.key() == "length") {
@ -37,9 +35,7 @@ TensorExternalData::TensorExternalData(const ONNX_NAMESPACE::TensorProto& tensor
Buffer<ov::MappedMemory> TensorExternalData::load_external_mmap_data(const std::string& model_dir,
MappedMemoryHandles cache) const {
NGRAPH_SUPPRESS_DEPRECATED_START
auto full_path = file_util::path_join(model_dir, m_data_location);
NGRAPH_SUPPRESS_DEPRECATED_END
auto full_path = ov::util::path_join({model_dir, m_data_location});
const int64_t file_size = ov::util::file_size(full_path);
if (file_size <= 0 || m_offset + m_data_length > static_cast<uint64_t>(file_size)) {
throw error::invalid_external_data{*this};
@ -62,17 +58,16 @@ Buffer<ov::MappedMemory> TensorExternalData::load_external_mmap_data(const std::
}
Buffer<ngraph::runtime::AlignedBuffer> TensorExternalData::load_external_data(const std::string& model_dir) const {
NGRAPH_SUPPRESS_DEPRECATED_START
auto full_path = file_util::path_join(model_dir, m_data_location);
auto full_path = ov::util::path_join({model_dir, m_data_location});
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
NGRAPH_SUPPRESS_DEPRECATED_START
file_util::convert_path_win_style(full_path);
NGRAPH_SUPPRESS_DEPRECATED_END
std::ifstream external_data_stream(ov::util::string_to_wstring(full_path).c_str(),
std::ios::binary | std::ios::in | std::ios::ate);
#else
std::ifstream external_data_stream(full_path, std::ios::binary | std::ios::in | std::ios::ate);
#endif
NGRAPH_SUPPRESS_DEPRECATED_END
if (external_data_stream.fail()) {
throw error::invalid_external_data{*this};

View File

@ -30,8 +30,8 @@ target_include_directories(${TARGET_NAME}
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime)
link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx)
ov_link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})

View File

@ -100,7 +100,7 @@ foreach(src IN LISTS SRC MULTI_TEST_SRC)
list(APPEND full_src_names "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
endif()
endforeach()
add_clang_format_target(ov_onnx_frontend_tests_clang FOR_SOURCES ${full_src_names})
ov_add_clang_format_target(ov_onnx_frontend_tests_clang FOR_SOURCES ${full_src_names})
foreach(BACKEND_NAME ${ACTIVE_BACKEND_LIST})
string(TOLOWER ${BACKEND_NAME} BACKEND_DIR)

View File

@ -1,6 +1,7 @@
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "onnx_fe_standalone_build_test")
add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
@ -10,4 +11,4 @@ add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::frontend::onnx)
# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <openvino/frontend/onnx/frontend.hpp>
#include "openvino/frontend/onnx/frontend.hpp"
void test_load() {
inline void test_load() {
ov::frontend::onnx::FrontEnd fe;
fe.get_name();
}

View File

@ -11,4 +11,4 @@ add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::frontend::paddle)
# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -4,7 +4,7 @@
#include <openvino/frontend/paddle/frontend.hpp>
void test_load() {
inline void test_load() {
ov::frontend::paddle::FrontEnd fe;
fe.get_name();
}

View File

@ -10,4 +10,4 @@ add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
target_link_libraries(${TARGET_NAME} PUBLIC openvino_tensorflow_frontend)
# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -4,7 +4,7 @@
#include <openvino/frontend/tensorflow/frontend.hpp>
void test_load() {
inline void test_load() {
ov::frontend::tensorflow::FrontEnd fe;
fe.get_name();
}

View File

@ -15,6 +15,11 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_STATIC_LIBRARY)
endif()
# remove -Wmissing-declarations warning, because of frontends implementation specific
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
target_compile_options(${TARGET_NAME} PRIVATE -Wno-missing-declarations)
endif()
set_target_properties(${TARGET_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
@ -25,7 +30,7 @@ target_include_directories(${TARGET_NAME}
PUBLIC $<BUILD_INTERFACE:${root_dir}/include>
PRIVATE ${root_dir}/src)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}

View File

@ -1,6 +1,7 @@
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME "tensorflow_lite_fe_standalone_build_test")
add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
@ -10,4 +11,4 @@ add_library(${TARGET_NAME} STATIC standalone_build_test.cpp)
target_link_libraries(${TARGET_NAME} PUBLIC openvino_tensorflow_lite_frontend)
# Enable code style check
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -4,7 +4,7 @@
#include <openvino/frontend/tensorflow_lite/frontend.hpp>
void test_load() {
inline void test_load() {
ov::frontend::tensorflow_lite::FrontEnd fe;
fe.get_name();
}

View File

@ -30,4 +30,4 @@ target_compile_definitions(${TARGET_NAME}
SHARED_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"
SHARED_LIB_SUFFIX="${IE_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})

View File

@ -47,7 +47,7 @@ add_library(${TARGET_NAME} MODULE ${LIBRARY_SRC} ${LIBRARY_HEADERS})
target_compile_definitions(${TARGET_NAME} PRIVATE ${DEFINITIONS})
target_link_libraries(${TARGET_NAME} PRIVATE ${DEPENDENCIES})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -45,6 +45,8 @@
# define TF_LITE_EXT
#endif
namespace {
ov::OutputVector CustomTranslatorCommon_1(const ov::frontend::NodeContext& node) {
return ov::OutputVector();
}
@ -80,6 +82,8 @@ std::map<std::string, ov::OutputVector> Relu6ToReluTranslatorPaddle(const ov::fr
return ret;
}
} // namespace
class CustomElu : public ov::op::Op {
public:
OPENVINO_OP("CustomElu");

View File

@ -6,7 +6,7 @@ set (TARGET_NAME "inference_engine")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# TODO: Add IMPLEMENT_OPENVINO_API to inference_engine_obj
ie_add_compiler_flags(/wd4273)
ov_add_compiler_flags(/wd4273)
endif()
file (GLOB LIBRARY_SRC
@ -106,7 +106,7 @@ ov_set_threading_interface_for(${TARGET_NAME}_plugin_api)
file(GLOB_RECURSE plugin_api_src "${CMAKE_CURRENT_SOURCE_DIR}/dev_api/*.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/dev_api/*.h")
add_clang_format_target(${TARGET_NAME}_plugin_api_clang FOR_SOURCES ${plugin_api_src})
ov_add_clang_format_target(${TARGET_NAME}_plugin_api_clang FOR_SOURCES ${plugin_api_src})
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}_plugin_api
SOURCE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dev_api/openvino"
@ -126,7 +126,7 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME}_obj PUBLIC OPENVINO_STATIC_LIBRARY)
endif()
ie_faster_build(${TARGET_NAME}_obj
ov_build_target_faster(${TARGET_NAME}_obj
UNITY PCH PRIVATE "src/precomp.hpp"
)
@ -172,7 +172,7 @@ target_link_libraries(${TARGET_NAME} INTERFACE openvino::runtime)
target_include_directories(${TARGET_NAME} INTERFACE $<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}>
$<BUILD_INTERFACE:${PUBLIC_HEADERS_DIR}/ie>)
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${IE_STATIC_DEPENDENT_FILES} ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${PUBLIC_HEADERS})
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${IE_STATIC_DEPENDENT_FILES} ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${PUBLIC_HEADERS})
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}_obj
SOURCE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/openvino"

View File

@ -3,7 +3,7 @@
#
if(SUGGEST_OVERRIDE_SUPPORTED)
ie_add_compiler_flags(-Wno-suggest-override)
ov_add_compiler_flags(-Wno-suggest-override)
endif()
set(TARGET_NAME ov_inference_functional_tests)

View File

@ -17,6 +17,6 @@ ov_add_test_target(
)
check_cxx_compiler_flag(-Wno-suggest-override SUPPORT_WNO_SUGGEST_OVERRIDE)
if (SUPPORT_WNO_SUGGEST_OVERRIDE)
ie_add_compiler_flags(-Wno-suggest-override)
if(SUPPORT_WNO_SUGGEST_OVERRIDE)
ov_add_compiler_flags(-Wno-suggest-override)
endif()

View File

@ -42,6 +42,6 @@ endif()
ov_set_threading_interface_for(${TARGET_NAME})
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

View File

@ -21,7 +21,7 @@ ov_add_plugin(NAME ${TARGET_NAME}
target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads)
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})

View File

@ -18,14 +18,14 @@ ov_add_plugin(NAME ${TARGET_NAME}
VERSION_DEFINES_FOR src/version.cpp
ADD_CLANG_FORMAT)
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
)
target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml)
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
@ -33,7 +33,7 @@ if(BUILD_SHARED_LIBS)
set(OBJ_NAME ${TARGET_NAME}_obj)
add_library(${OBJ_NAME} OBJECT ${SOURCES} ${HEADERS})
link_system_libraries(${OBJ_NAME} PUBLIC openvino::pugixml)
ov_link_system_libraries(${OBJ_NAME} PUBLIC openvino::pugixml)
ov_add_version_defines(src/version.cpp ${OBJ_NAME})
@ -45,7 +45,7 @@ if(BUILD_SHARED_LIBS)
${CMAKE_CURRENT_SOURCE_DIR}/src
$<TARGET_PROPERTY:openvino::conditional_compilation,INTERFACE_INCLUDE_DIRECTORIES>)
set_ie_threading_interface_for(${OBJ_NAME})
ov_set_threading_interface_for(${OBJ_NAME})
target_compile_definitions(${OBJ_NAME}
PRIVATE
@ -63,4 +63,4 @@ endif()
if(ENABLE_FUNCTIONAL_TESTS)
add_subdirectory(tests/functional)
endif()
endif()

View File

@ -10,14 +10,14 @@ set(TARGET_NAME "openvino_intel_cpu_plugin")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# C4267, 4244 issues from oneDNN headers conversion from 'XXX' to 'YYY', possible loss of data
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4244)
# mkldnn headers: '<<': result of 32-bit shift implicitly converted to 64 bits
ie_add_compiler_flags(/wd4334)
ov_add_compiler_flags(/wd4334)
# oneDNN arm64: unary minus operator applied to unsigned type, result still unsigned
ie_add_compiler_flags(/wd4146)
ov_add_compiler_flags(/wd4146)
elseif(OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
ov_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
endif()
if(ARM)
@ -142,7 +142,7 @@ target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml)
ov_set_threading_interface_for(${TARGET_NAME})
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
@ -153,7 +153,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_REL
if(BUILD_SHARED_LIBS)
add_library(${TARGET_NAME}_obj OBJECT ${SOURCES} ${HEADERS})
link_system_libraries(${TARGET_NAME}_obj PUBLIC dnnl openvino::pugixml)
ov_link_system_libraries(${TARGET_NAME}_obj PUBLIC dnnl openvino::pugixml)
ov_add_version_defines(src/plugin.cpp ${TARGET_NAME}_obj)

View File

@ -7,15 +7,15 @@ add_subdirectory(unit)
if(ENABLE_FUNCTIONAL_TESTS)
function(ov_cpu_func_tests)
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-unused-function)
ie_add_compiler_flags(-Wno-parentheses)
ie_add_compiler_flags(-Wno-unused-local-typedefs)
ie_add_compiler_flags(-Wno-reorder)
ie_add_compiler_flags(-Wno-comment)
ie_add_compiler_flags(-Wno-unused-local-typedefs)
ov_add_compiler_flags(-Wno-unused-function)
ov_add_compiler_flags(-Wno-parentheses)
ov_add_compiler_flags(-Wno-unused-local-typedefs)
ov_add_compiler_flags(-Wno-reorder)
ov_add_compiler_flags(-Wno-comment)
ov_add_compiler_flags(-Wno-unused-local-typedefs)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
ie_add_compiler_flags(-Wno-unused-but-set-variable)
ov_add_compiler_flags(-Wno-unused-but-set-variable)
endif()
add_subdirectory(functional)

View File

@ -9,7 +9,7 @@ if(BUILD_SHARED_LIBS)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
ie_add_compiler_flags(/wd5051)
ov_add_compiler_flags(/wd5051)
endif()
if (X86_64)
@ -77,7 +77,7 @@ if (WIN32)
target_compile_definitions(${TARGET_NAME} PRIVATE NOMINMAX)
endif()
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
)

View File

@ -78,30 +78,30 @@ function(ov_add_onednn)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-undef)
ie_add_compiler_flags(-Wno-missing-declarations)
ov_add_compiler_flags(-Wno-undef)
ov_add_compiler_flags(-Wno-missing-declarations)
if(ARM OR AARCH64)
ie_add_compiler_flags(-Wno-macro-redefined)
ov_add_compiler_flags(-Wno-macro-redefined)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-array-bounds)
ie_add_compiler_flags(-Wno-stringop-overflow)
ov_add_compiler_flags(-Wno-array-bounds)
ov_add_compiler_flags(-Wno-stringop-overflow)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
ie_add_compiler_flags(-Wno-restrict)
ov_add_compiler_flags(-Wno-restrict)
endif()
endif()
elseif(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable=10121")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# C4849 OpenMP 'reduction' clause ignored in 'simd' directive
ie_add_compiler_flags(/wd4849)
ov_add_compiler_flags(/wd4849)
# C4661 no suitable definition provided for explicit template instantiation request
ie_add_compiler_flags(/wd4661)
ov_add_compiler_flags(/wd4661)
# C4267, 4244 conversion from 'XXX' to 'YYY', possible loss of data
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4244)
# C4334 '<<': result of 32-bit shift implicitly converted to 64 bits
ie_add_compiler_flags(/wd4334)
ov_add_compiler_flags(/wd4334)
endif()
if(SUGGEST_OVERRIDE_SUPPORTED)

View File

@ -58,7 +58,7 @@ target_compile_definitions(${TARGET_NAME}
)
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
#
# Static version for tests

View File

@ -28,7 +28,7 @@ add_library(${TARGET_NAME}_obj OBJECT EXCLUDE_FROM_ALL
${LIBRARY_SRC}
${PUBLIC_HEADERS})
ie_faster_build(${TARGET_NAME}_obj
ov_build_target_faster(${TARGET_NAME}_obj
PCH PRIVATE "src/precomp.hpp")
target_include_directories(${TARGET_NAME}_obj PRIVATE
@ -43,7 +43,7 @@ target_compile_definitions(${TARGET_NAME}_obj PRIVATE $<TARGET_PROPERTY:ngraph,I
target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt)
add_clang_format_target(${TARGET_NAME}_obj_clang FOR_TARGETS ${TARGET_NAME}_obj)
ov_add_clang_format_target(${TARGET_NAME}_obj_clang FOR_TARGETS ${TARGET_NAME}_obj)
# Create static library

View File

@ -3,8 +3,8 @@
#
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-missing-declarations)
ie_add_compiler_flags(-Wno-bool-compare)
ov_add_compiler_flags(-Wno-missing-declarations)
ov_add_compiler_flags(-Wno-bool-compare)
endif()
set(TARGET_NAME ov_legacy_transformations_tests)

View File

@ -5,18 +5,18 @@
enable_testing()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
ie_add_compiler_flags(/wd4244)
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4305)
ie_add_compiler_flags(/wd4273)
ie_add_compiler_flags(/wd4661)
ie_add_compiler_flags(/wd4018)
ie_add_compiler_flags(/wd4334)
ie_add_compiler_flags(/wd4250)
ov_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4305)
ov_add_compiler_flags(/wd4273)
ov_add_compiler_flags(/wd4661)
ov_add_compiler_flags(/wd4018)
ov_add_compiler_flags(/wd4334)
ov_add_compiler_flags(/wd4250)
else()
ie_add_compiler_flags(-Wno-missing-declarations)
ie_add_compiler_flags(-Wno-odr)
ie_add_compiler_flags(-Wno-all)
ov_add_compiler_flags(-Wno-missing-declarations)
ov_add_compiler_flags(-Wno-odr)
ov_add_compiler_flags(-Wno-all)
endif()
if(ENABLE_TESTS)

View File

@ -5,20 +5,20 @@
enable_testing()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
ie_add_compiler_flags(/wd4244)
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4305)
ie_add_compiler_flags(/wd4273)
ie_add_compiler_flags(/wd4661)
ie_add_compiler_flags(/wd4018)
ie_add_compiler_flags(/wd4334)
ov_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4305)
ov_add_compiler_flags(/wd4273)
ov_add_compiler_flags(/wd4661)
ov_add_compiler_flags(/wd4018)
ov_add_compiler_flags(/wd4334)
endif()
if(NOT MSVC)
ie_add_compiler_flags(-Wno-missing-declarations)
ie_add_compiler_flags(-Wno-all)
ie_add_compiler_flags(-Wno-unused-variable)
ie_add_compiler_flags(-Wno-unused-function)
ov_add_compiler_flags(-Wno-missing-declarations)
ov_add_compiler_flags(-Wno-all)
ov_add_compiler_flags(-Wno-unused-variable)
ov_add_compiler_flags(-Wno-unused-function)
endif()
add_subdirectory(readers)

View File

@ -23,7 +23,7 @@ endif()
add_library(${TARGET_NAME} ${library_type} ${LIBRARY_SRC})
ie_faster_build(${TARGET_NAME}
ov_build_target_faster(${TARGET_NAME}
UNITY
)
@ -46,11 +46,11 @@ if(BUILD_SHARED_LIBS)
endif()
# must be called after all target_link_libraries
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
# code style
add_clang_format_target(${TARGET_NAME}_clang_format FOR_TARGETS ${TARGET_NAME})
ov_add_clang_format_target(${TARGET_NAME}_clang_format FOR_TARGETS ${TARGET_NAME})
# Install rules

View File

@ -3,7 +3,7 @@
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
ie_add_compiler_flags(-Wno-literal-conversion)
ov_add_compiler_flags(-Wno-literal-conversion)
endif()
set(TARGET_NAME ov_gna_func_tests)

View File

@ -9,22 +9,22 @@ endif()
set (TARGET_NAME "openvino_intel_gpu_plugin")
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Wno-strict-aliasing)
ov_add_compiler_flags(-Wno-strict-aliasing)
endif()
if(OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
ov_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# 4267 4244 conversion from 'XXX' to 'YYY', possible loss of data
ie_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4244)
# '<': signed/unsigned mismatch
ie_add_compiler_flags(/wd4018)
ov_add_compiler_flags(/wd4018)
endif()
if(ENABLE_GPU_DEBUG_CAPS)
add_definitions(-DGPU_DEBUG_CONFIG=1)
add_definitions(-DGPU_DEBUG_CONFIG=1)
endif()
set(INTEL_GPU_TARGET_OCL_VERSION "200" CACHE STRING "Target version of OpenCL which should be used by GPU plugin")
@ -38,7 +38,7 @@ add_subdirectory(thirdparty)
include(thirdparty/cmake/rapidjson.cmake)
if(CMAKE_COMPILER_IS_GNUCXX)
ie_add_compiler_flags(-Werror)
ov_add_compiler_flags(-Werror)
endif()
add_subdirectory(src/runtime)
@ -79,4 +79,4 @@ endif()
# Failed because of OpenCL
# must be called after all target_link_libraries
# ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
# ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})

View File

@ -6,10 +6,10 @@ set(TARGET_NAME ov_gpu_func_tests)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# C4267, 4244 issues from oneDNN headers conversion from 'XXX' to 'YYY', possible loss of data
ie_add_compiler_flags(/wd4267)
ie_add_compiler_flags(/wd4244)
ov_add_compiler_flags(/wd4267)
ov_add_compiler_flags(/wd4244)
# 'initializing': truncation from 'XXX' to 'YYY'
ie_add_compiler_flags(/wd4305)
ov_add_compiler_flags(/wd4305)
endif()
addIeTargetTest(

Some files were not shown because too many files have changed in this diff Show More