Fixed LTO for gcc-9 (ubuntu 20.04) (#2616)
* Fixed LTO for gcc-9 (ubuntu 20.04) * Fixed ODR rules violation for MKLDNN deprecated functional tests * Fixed tests build for templatePlugin
This commit is contained in:
1 parent
a1b8a11000
commit
39e7905fe1
13 files changed
+41
-66
No files matched your search
@@ -152,7 +152,7 @@ macro(ie_enable_lto)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
|
||||
endif()
|
||||
|
||||
# modify linker and ar
|
||||
# modify runlib and ar tools
|
||||
if(LINUX)
|
||||
set(CMAKE_AR "gcc-ar")
|
||||
set(CMAKE_RANLIB "gcc-ranlib")
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if(ENABLE_LTO AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
|
||||
ie_enable_lto()
|
||||
endif()
|
||||
|
||||
# [cmake:functional_tests]
|
||||
set(TARGET_NAME templateFuncTests)
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ if (ENABLE_OPENCV)
|
||||
set(OPENCV_BUILD "36")
|
||||
set(OPENCV_BUILD_YOCTO "337")
|
||||
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||
if(DEFINED ENV{THIRDPARTY_SERVER_PATH})
|
||||
set(IE_PATH_TO_DEPS "$ENV{THIRDPARTY_SERVER_PATH}")
|
||||
elseif(DEFINED THIRDPARTY_SERVER_PATH)
|
||||
@@ -220,18 +220,18 @@ if (ENABLE_OPENCV)
|
||||
ENVIRONMENT "OpenCV_DIR"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+).*")
|
||||
elseif(LINUX)
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||
set(OPENCV_SUFFIX "yocto_kmb")
|
||||
set(OPENCV_BUILD "${OPENCV_BUILD_YOCTO}")
|
||||
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
|
||||
set(OPENCV_SUFFIX "debian9arm")
|
||||
elseif (${LINUX_OS_NAME} STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
||||
elseif (LINUX_OS_NAME STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
||||
set(OPENCV_SUFFIX "centos7")
|
||||
elseif (${LINUX_OS_NAME} STREQUAL "Ubuntu 16.04")
|
||||
elseif (LINUX_OS_NAME STREQUAL "Ubuntu 16.04")
|
||||
set(OPENCV_SUFFIX "ubuntu16")
|
||||
elseif (${LINUX_OS_NAME} STREQUAL "Ubuntu 18.04")
|
||||
elseif (LINUX_OS_NAME STREQUAL "Ubuntu 18.04")
|
||||
set(OPENCV_SUFFIX "ubuntu18")
|
||||
elseif (${LINUX_OS_NAME} STREQUAL "Ubuntu 20.04")
|
||||
elseif (LINUX_OS_NAME STREQUAL "Ubuntu 20.04")
|
||||
set(OPENCV_SUFFIX "ubuntu20")
|
||||
else()
|
||||
message(FATAL_ERROR "OpenCV is not available on current platform")
|
||||
@@ -311,7 +311,7 @@ if (ENABLE_SPEECH_DEMO)
|
||||
TARGET_PATH "${TEMP}/speech_demo_1.0.0.746")
|
||||
debug_message(STATUS "speech_libs_and_demos=" ${SPEECH_LIBS_AND_DEMOS})
|
||||
elseif (LINUX AND X86_64)
|
||||
if (${LINUX_OS_NAME} STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
||||
if (LINUX_OS_NAME STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
||||
RESOLVE_DEPENDENCY(SPEECH_LIBS_AND_DEMOS
|
||||
ARCHIVE_LIN "speech_demo_1.0.0.751_centos.tgz"
|
||||
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
|
||||
|
||||
@@ -48,14 +48,7 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE
|
||||
|
||||
# Create shared library
|
||||
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
# according to https://cmake.org/cmake/help/latest/command/add_library.html#id4
|
||||
# Some native build systems (such as Xcode) may not like targets that have only
|
||||
# object files, so consider adding at least one real source file to any target that
|
||||
# references $<TARGET_OBJECTS:objlib>.
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>
|
||||
$<TARGET_OBJECTS:inference_engine_common_obj>)
|
||||
|
||||
@@ -63,7 +56,7 @@ set_ie_threading_interface_for(${TARGET_NAME})
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ${CMAKE_DL_LIBS} ${NGRAPH_LIBRARIES} inference_engine_transformations pugixml openvino::itt)
|
||||
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME} EXCLUDE_PATTERNS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
||||
|
||||
# export targets
|
||||
|
||||
|
||||
@@ -205,8 +205,6 @@ set_ie_threading_interface_for(${TARGET_NAME}_obj)
|
||||
target_compile_definitions(${TARGET_NAME}_obj PUBLIC -DMKLDNN_THR=${MKLDNN_THR}
|
||||
PRIVATE USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN)
|
||||
|
||||
set(mkldnn_plugin_object_libraries "${TARGET_NAME}_obj" CACHE INTERNAL "" FORCE)
|
||||
|
||||
# install
|
||||
|
||||
if(GEMM STREQUAL "MKL")
|
||||
|
||||
@@ -143,14 +143,7 @@ set_ie_threading_interface_for(${TARGET_NAME}_obj)
|
||||
|
||||
# Create shared library file from object library
|
||||
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
# according to https://cmake.org/cmake/help/latest/command/add_library.html#id4
|
||||
# Some native build systems (such as Xcode) may not like targets that have only
|
||||
# object files, so consider adding at least one real source file to any target that
|
||||
# references $<TARGET_OBJECTS:objlib>.
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
|
||||
|
||||
set_ie_threading_interface_for(${TARGET_NAME})
|
||||
@@ -170,8 +163,7 @@ if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})
|
||||
endif()
|
||||
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}
|
||||
EXCLUDE_PATTERNS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
||||
|
||||
# Static library used for unit tests which are always built
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(add_ie_target)
|
||||
if(ENABLE_LTO AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
|
||||
ie_enable_lto()
|
||||
endif()
|
||||
|
||||
#####################################################################################################
|
||||
# SETUP TESTS #
|
||||
#####################################################################################################
|
||||
set(IE_TESTS_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
enable_testing()
|
||||
|
||||
@@ -9,4 +9,4 @@ endif()
|
||||
|
||||
if (ENABLE_FUNCTIONAL_TESTS)
|
||||
add_subdirectory(functional_test_utils)
|
||||
endif()
|
||||
endif()
|
||||
@@ -4,11 +4,6 @@
|
||||
|
||||
set(TARGET_NAME cpuUnitTests)
|
||||
|
||||
foreach (obj_lib IN LISTS mkldnn_plugin_object_libraries)
|
||||
list(APPEND mkldnn_object_files $<TARGET_OBJECTS:${obj_lib}>)
|
||||
endforeach ()
|
||||
list(APPEND MKLDNN_SRC_OBJ ${mkldnn_object_files})
|
||||
|
||||
addIeTargetTest(
|
||||
NAME ${TARGET_NAME}
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -16,7 +11,7 @@ addIeTargetTest(
|
||||
${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin
|
||||
${IE_MAIN_SOURCE_DIR}/src/transformations/include
|
||||
OBJECT_FILES
|
||||
${MKLDNN_SRC_OBJ}
|
||||
$<TARGET_OBJECTS:MKLDNNPlugin_obj>
|
||||
LINK_LIBRARIES
|
||||
unitTestUtils
|
||||
mkldnn
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
#####################################################################################################
|
||||
# SETUP TESTS #
|
||||
#####################################################################################################
|
||||
if(ENABLE_LTO AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
|
||||
ie_enable_lto()
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
@@ -25,5 +25,5 @@ endif()
|
||||
disable_deprecated_warnings()
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(unit)
|
||||
add_subdirectory(unit)
|
||||
endif()
|
||||
+15
-15
@@ -17,7 +17,7 @@ using namespace ::testing;
|
||||
using namespace InferenceEngine;
|
||||
using namespace InferenceEngine::details;
|
||||
|
||||
struct conv_base_params {
|
||||
struct conv_int8_base_params {
|
||||
struct {
|
||||
size_t w;
|
||||
size_t h;
|
||||
@@ -42,11 +42,11 @@ struct conv_base_params {
|
||||
} out;
|
||||
};
|
||||
|
||||
struct conv_test_int8_params : conv_base_params {
|
||||
struct conv_test_int8_params : conv_int8_base_params {
|
||||
std::string device_name;
|
||||
|
||||
conv_test_int8_params(std::string name, conv_base_params params) :
|
||||
conv_base_params(params), device_name(name) {}
|
||||
conv_test_int8_params(std::string name, conv_int8_base_params params) :
|
||||
conv_int8_base_params(params), device_name(name) {}
|
||||
};
|
||||
|
||||
template <typename data_t>
|
||||
@@ -403,19 +403,19 @@ protected:
|
||||
*/
|
||||
// Wo=(Wi−F+2P)/S+1
|
||||
|
||||
#define case_1 conv_base_params({{4, 4, 3}, 1, 1, 1, 1, 0, 0, 0, 0, 3, 1})
|
||||
#define case_2 conv_base_params({{16, 32, 3}, 2, 4, 1, 1, 0, 0, 0, 0, 17, 1})
|
||||
#define case_3 conv_base_params({{16, 32, 3}, 2, 4, 2, 1, 0, 0, 0, 0, 17, 1})
|
||||
#define case_4 conv_base_params({{40, 40, 3}, 3, 3, 1, 2, 0, 0, 0, 0, 20, 1})
|
||||
#define case_5 conv_base_params({{32, 16, 3}, 7, 7, 2, 2, 3, 3, 0, 0, 17, 1})
|
||||
#define case_6 conv_base_params({{224, 224, 3}, 7, 7, 2, 2, 2, 2, 0, 0, 64, 1, {112, 112}})
|
||||
/*#define case_7 conv_base_params({{40, 40, 16}, 3, 3, 1, 1, 0, 0, 0, 0, 16, 16})
|
||||
#define case_8 conv_base_params({{32, 16, 32}, 7, 7, 2, 2, 3, 3, 0, 0, 32, 32})*/
|
||||
#define case_1 conv_int8_base_params({{4, 4, 3}, 1, 1, 1, 1, 0, 0, 0, 0, 3, 1})
|
||||
#define case_2 conv_int8_base_params({{16, 32, 3}, 2, 4, 1, 1, 0, 0, 0, 0, 17, 1})
|
||||
#define case_3 conv_int8_base_params({{16, 32, 3}, 2, 4, 2, 1, 0, 0, 0, 0, 17, 1})
|
||||
#define case_4 conv_int8_base_params({{40, 40, 3}, 3, 3, 1, 2, 0, 0, 0, 0, 20, 1})
|
||||
#define case_5 conv_int8_base_params({{32, 16, 3}, 7, 7, 2, 2, 3, 3, 0, 0, 17, 1})
|
||||
#define case_6 conv_int8_base_params({{224, 224, 3}, 7, 7, 2, 2, 2, 2, 0, 0, 64, 1, {112, 112}})
|
||||
/*#define case_7 conv_int8_base_params({{40, 40, 16}, 3, 3, 1, 1, 0, 0, 0, 0, 16, 16})
|
||||
#define case_8 conv_int8_base_params({{32, 16, 32}, 7, 7, 2, 2, 3, 3, 0, 0, 32, 32})*/
|
||||
|
||||
// These tests use dilated convolution and don't work yet
|
||||
/*#define case_9 conv_base_params({{40, 40, 16}, 3, 3, 1, 1, 0, 0, 8, 8, 16, 16})
|
||||
#define case_10 conv_base_params({{32, 16, 32}, 7, 7, 2, 2, 3, 3, 8, 8, 32, 32})
|
||||
#define case_11 conv_base_params({{32, 16, 4}, 7, 7, 2, 2, 3, 3, 8, 8, 4, 4})*/
|
||||
/*#define case_9 conv_int8_base_params({{40, 40, 16}, 3, 3, 1, 1, 0, 0, 8, 8, 16, 16})
|
||||
#define case_10 conv_int8_base_params({{32, 16, 32}, 7, 7, 2, 2, 3, 3, 8, 8, 32, 32})
|
||||
#define case_11 conv_int8_base_params({{32, 16, 4}, 7, 7, 2, 2, 3, 3, 8, 8, 4, 4})*/
|
||||
|
||||
TEST_P(smoke_ConvolutionInt8Test, TestsConvolution) {
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ if (ENABLE_CLDNN)
|
||||
HeteroPlugin)
|
||||
endif()
|
||||
|
||||
include(add_ie_target)
|
||||
|
||||
addIeTarget(
|
||||
NAME myriadTestData
|
||||
DEVELOPER_PACKAGE
|
||||
|
||||
@@ -6,7 +6,7 @@ cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
set(TARGET_NAME InferenceEngineUnitTests)
|
||||
|
||||
#rpath enabled for unit tests only
|
||||
# rpath enabled for unit tests only
|
||||
SET (CMAKE_SKIP_RPATH OFF)
|
||||
|
||||
# collect sources
|
||||
@@ -71,11 +71,7 @@ if (ENABLE_MKL_DNN)
|
||||
${CMAKE_BINARY_DIR}/include/)
|
||||
|
||||
source_group("mkldnn" FILES ${MKLDNN_TESTS} ${MKLDNN_TESTS_INCLUDE})
|
||||
|
||||
foreach(obj_lib IN LISTS mkldnn_plugin_object_libraries)
|
||||
list(APPEND mkldnn_object_files $<TARGET_OBJECTS:${obj_lib}>)
|
||||
endforeach()
|
||||
list(APPEND MKLDNN_TESTS ${mkldnn_object_files})
|
||||
list(APPEND MKLDNN_TESTS $<TARGET_OBJECTS:MKLDNNPlugin_obj>)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_MYRIAD)
|
||||
|
||||
Reference in new issue
Block a user