Skip to content

Commit

Permalink
Merge pull request #278 from asuhov/2019-r3
Browse files Browse the repository at this point in the history
Publishing 2019 R3 content
  • Loading branch information
asuhov committed Oct 4, 2019
2 parents ba6e22b + 0923303 commit 1c794d9
Show file tree
Hide file tree
Showing 1,734 changed files with 72,081 additions and 58,959 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [OpenVINO™ Toolkit](https://01.org/openvinotoolkit) - Deep Learning Deployment Toolkit repository
[![Stable release](https://img.shields.io/badge/version-2019.R2-green.svg)](https://github.com/opencv/dldt/releases/tag/2019_R2)
[![Stable release](https://img.shields.io/badge/version-2019.R3-green.svg)](https://github.com/opencv/dldt/releases/tag/2019_R3)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)

This toolkit allows developers to deploy pre-trained deep learning models through a high-level C++ Inference Engine API integrated with application logic.
Expand Down
3 changes: 3 additions & 0 deletions inference-engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})

# remove file with exported developer targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/targets_developer.cmake")

add_subdirectory(src)

if(ENABLE_TESTS)
Expand Down
82 changes: 63 additions & 19 deletions inference-engine/cmake/FindlibGNA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,79 @@
# SPDX-License-Identifier: Apache-2.0
#

#module to locate GNA libraries
# module to locate GNA libraries

if (WIN32)
set(GNA_PLATFORM_DIR win64)
set(GNA_LIB_DIR x64)
set(GNA_LIB gna)
elseif (UNIX)
set(GNA_PLATFORM_DIR linux)
set(GNA_LIB_DIR lib)
set(GNA_LIB gna_api)
set(GNA_KERNEL_LIB gna_kernel)
else ()
message(FATAL_ERROR "GNA not supported on this platform, only linux, and windows")
endif ()

find_library(GNA_API_LIBRARY
${GNA_LIB}
HINTS
${GNA}/${GNA_PLATFORM_DIR}/${GNA_LIB_DIR})
set(libGNA_FOUND TRUE)

set(GNA_KERNEL_LIB_NAME gna)
set(GNA_LIBS_LIST
"libGNA::API"
"libGNA::KERNEL")

set(libGNA_INCLUDE_DIRS ${GNA}/${GNA_PLATFORM_DIR}/include)
set(libGNA_LIBRARY ${GNA_API_LIBRARY})
if (GNA_LIBRARY_VERSION STREQUAL "GNA1")
# use old version of GNA Library from gna_20181120
if (WIN32)
set(GNA_LIB_DIR x64)
else ()
list(APPEND GNA_LIBS_LIST
"libGNA::OLD_API_LIB")
set(GNA_LIB_DIR lib)
set(GNA_KERNEL_LIB_NAME gna_kernel)
endif()
set(libGNA_INCLUDE_DIRS "${GNA}/${GNA_PLATFORM_DIR}/include")
else()
# use current version of GNA library
set(GNA_LIB_DIR x64)
set(libGNA_INCLUDE_DIRS "${GNA}/include")
endif()
set(libGNA_LIBRARIES_BASE_PATH ${GNA}/${GNA_PLATFORM_DIR}/${GNA_LIB_DIR})

add_library(libGNA::KERNEL SHARED IMPORTED)
find_library(GNA_KERNEL_LIBRARY
${GNA_KERNEL_LIB_NAME}
HINTS
${libGNA_LIBRARIES_BASE_PATH})
set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_LOCATION ${GNA_KERNEL_LIBRARY})

if (UNIX)
#message("Searching for libgna_kernel.so in: ${GNA}/${GNA_PLATFORM_DIR}/${GNA_KERNEL_LIB}")
find_library(GNA_KERNEL_LIBRARY
${GNA_KERNEL_LIB}
if ((GNA_LIBRARY_VERSION STREQUAL "GNA1") AND (NOT WIN32))
add_library(libGNA::OLD_API_LIB SHARED IMPORTED)
find_library(GNA_API_LIBRARY
gna_api
HINTS
${GNA}/${GNA_PLATFORM_DIR}/${GNA_LIB_DIR})
endif ()
${libGNA_LIBRARIES_BASE_PATH})
set_target_properties(libGNA::OLD_API_LIB PROPERTIES IMPORTED_LOCATION ${GNA_API_LIBRARY})
target_link_libraries(libGNA::OLD_API_LIB INTERFACE libGNA::KERNEL)
set_target_properties(libGNA::OLD_API_LIB PROPERTIES IMPORTED_NO_SONAME TRUE)
set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_NO_SONAME TRUE)
endif()

add_library(libGNA::API INTERFACE IMPORTED)
set_property(TARGET libGNA::API PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${libGNA_INCLUDE_DIRS})

add_library(libGNA INTERFACE IMPORTED)
foreach(_lib_name ${GNA_LIBS_LIST})
set_property(TARGET libGNA APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${_lib_name})

set(libGNA_LIBRARIES ${libGNA_LIBRARY} ${GNA_KERNEL_LIBRARY})
get_target_property(_target_type ${_lib_name} TYPE)
if (${_target_type} STREQUAL "INTERFACE_LIBRARY")
get_target_property(_target_location ${_lib_name} INTERFACE_INCLUDE_DIRECTORIES)
else()
get_target_property(_target_location ${_lib_name} IMPORTED_LOCATION)
endif ()
message(STATUS "${_lib_name} ${_target_type} : ${_target_location}")
endforeach(_lib_name)

if (WIN32)
set_target_properties(libGNA::KERNEL PROPERTIES
IMPORTED_IMPLIB ${GNA_KERNEL_LIBRARY})
elseif(NOT GNA_LIBRARY_VERSION STREQUAL "GNA1")
set_target_properties(libGNA PROPERTIES INTERFACE_LINK_OPTIONS "-Wl,-rpath-link,${libGNA_LIBRARIES_BASE_PATH}")
endif ()
41 changes: 35 additions & 6 deletions inference-engine/cmake/check_features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ endif()
if (APPLE)
set(ENABLE_GNA OFF)
set(ENABLE_CLDNN OFF)
SET(ENABLE_MYRIAD OFF)
SET(ENABLE_VPU OFF)
endif()


Expand Down Expand Up @@ -66,18 +64,39 @@ if (ENABLE_MKL_DNN)
add_definitions(-DENABLE_MKL_DNN=1)
endif()

if (ENABLE_UNICODE_PATH_SUPPORT)
add_definitions(-DENABLE_UNICODE_PATH_SUPPORT=1)
endif()

if (ENABLE_GNA)
add_definitions(-DENABLE_GNA)

set (DEFAULT_GNA_LIB GNA1_1401)

# "GNA library version: GNA1|GNA1_1401|GNA2" - default is 1401
if (NOT GNA_LIBRARY_VERSION STREQUAL "GNA1"
AND NOT GNA_LIBRARY_VERSION STREQUAL "GNA1_1401"
AND NOT GNA_LIBRARY_VERSION STREQUAL "GNA2")
set (GNA_LIBRARY_VERSION ${DEFAULT_GNA_LIB})
message(STATUS "GNA_LIBRARY_VERSION not set. Can be GNA1, GNA1_1401 or GNA2. Default is ${GNA_LIBRARY_VERSION}")
endif()

if (GNA_LIBRARY_VERSION STREQUAL "GNA2")
message(WARNING "GNA2 is not currently supported. Fallback to ${DEFAULT_GNA_LIB}")
set(GNA_LIBRARY_VERSION ${DEFAULT_GNA_LIB})
endif()

if (UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4)
message(WARNING "${GNA_LIBRARY_VERSION} no supported on GCC version ${CMAKE_CXX_COMPILER_VERSION}. Fallback to GNA1")
set(GNA_LIBRARY_VERSION GNA1)
endif()

set(GNA_LIBRARY_VERSION "${GNA_LIBRARY_VERSION}" CACHE STRING "GNAVersion" FORCE)
list (APPEND IE_OPTIONS GNA_LIBRARY_VERSION)
endif()

if (ENABLE_SAMPLES)
set (ENABLE_SAMPLES_CORE ON)
endif()

#models dependend tests

if (DEVELOPMENT_PLUGIN_MODE)
message (STATUS "Enabled development plugin mode")

Expand All @@ -93,8 +112,18 @@ if (DEVELOPMENT_PLUGIN_MODE)
endif()
endif()

if (NOT ENABLE_TESTS)
set(ENABLE_GNA_MODELS OFF)
endif ()

if (VERBOSE_BUILD)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()


if(ENABLE_DUMP)
add_definitions(-DDEBUG_DUMP)
endif()


print_enabled_features()
3 changes: 3 additions & 0 deletions inference-engine/cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if(DEFINED IE_MAIN_SOURCE_DIR AND TARGET inference_engine)
set(InferenceEngine_LIBRARIES inference_engine)
else()
include("${CMAKE_CURRENT_LIST_DIR}/targets.cmake")
if(NOT WIN32)
set_target_properties(IE::inference_engine PROPERTIES INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
endif()
get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES)
set(InferenceEngine_LIBRARIES IE::inference_engine)
endif()
Loading

0 comments on commit 1c794d9

Please sign in to comment.