forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishing R5 content (openvinotoolkit#72)
* Publishing R5 content * Updated ade revision * updated readme * add possibility to build CPU plugin with Intel MKL package
- Loading branch information
Showing
42 changed files
with
10,552 additions
and
2,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,60 @@ | ||
# Copyright (C) 2018-2020 Intel Corporation | ||
# Copyright (C) 2018 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set(TARGET_NAME "GNAPlugin") | ||
|
||
if(ENABLE_LTO) | ||
ie_enable_lto() | ||
endif() | ||
|
||
file(GLOB_RECURSE SOURCES | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp | ||
) | ||
|
||
file(GLOB_RECURSE HEADERS | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp | ||
) | ||
|
||
addVersionDefines(gna_plugin_entry_points.cpp CI_BUILD_NUMBER) | ||
add_definitions(-DIMPLEMENT_INFERENCE_ENGINE_PLUGIN) | ||
|
||
find_package(libGNA) | ||
include_directories(${libGNA_INCLUDE_DIRS}) | ||
|
||
ie_add_plugin(NAME ${TARGET_NAME} | ||
DEVICE_NAME "GNA" | ||
SOURCES ${SOURCES} ${HEADERS}) | ||
include_directories( | ||
${CMAKE_SOURCE_DIR}/include | ||
${CMAKE_SOURCE_DIR}/src/inference_engine | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${libGNA_INCLUDE_DIRS} | ||
) | ||
|
||
if(GNA_LIBRARY_VERSION STREQUAL "GNA2") | ||
SET(GNA_LIBRARY_VERSION_NUMBER 2) | ||
else() | ||
SET(GNA_LIBRARY_VERSION_NUMBER 1) | ||
endif() | ||
add_definitions(-D_NO_MKL_) | ||
add_library(${TARGET_NAME} SHARED ${SOURCES} ${HEADERS}) | ||
|
||
#saving rpath to GNA shared library be used by CI | ||
log_rpath_from_dir(GNA ${libGNA_LIBRARIES_BASE_PATH}) | ||
if (LINUX) | ||
find_package(Threads) | ||
endif () | ||
|
||
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine inference_engine_lp_transformations ${INTEL_ITT_LIBS} Threads::Threads libGNA) | ||
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_compile_definitions(${TARGET_NAME} | ||
PRIVATE | ||
_NO_MKL_ | ||
PUBLIC | ||
GNA_LIB_VER=${GNA_LIBRARY_VERSION_NUMBER}) | ||
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}) | ||
|
||
#saving rpath to GNA shared library be used by CI | ||
log_rpath_remove_top(GNA FALSE "/gna${libGNA_LIBRARY}" TRUE) | ||
|
||
target_link_libraries(${TARGET_NAME} inference_engine ${INTEL_ITT_LIBS} ${libGNA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) | ||
|
||
add_library(${TARGET_NAME}_test_static STATIC ${SOURCES} ${HEADERS}) | ||
target_compile_definitions(${TARGET_NAME}_test_static | ||
PRIVATE | ||
_NO_MKL_ | ||
IMPLEMENT_INFERENCE_ENGINE_PLUGIN | ||
PUBLIC | ||
GNA_LIB_VER=${GNA_LIBRARY_VERSION_NUMBER} | ||
INTEGER_LOW_P | ||
USE_STATIC_IE) | ||
target_link_libraries(${TARGET_NAME}_test_static PUBLIC inference_engine_preproc_s inference_engine_lp_transformations libGNA::API) | ||
target_include_directories(${TARGET_NAME}_test_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set_target_properties(${TARGET_NAME}_test_static PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}_test_static) | ||
|
||
if(WIN32) | ||
# Correct 'jnl' macro/jit issue | ||
target_compile_options(${TARGET_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/bigobj> ) | ||
target_compile_options(${TARGET_NAME}_test_static PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/bigobj> ) | ||
endif() | ||
set(TEST_SOURCES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/gna_plugin.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/gna_plugin_passes.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/quantization/quantization.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/dnn.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/gna_device.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/pwl_design.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/floatmath.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/dnn_memory.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/util.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/gna_model_serial.cpp") | ||
|
||
# install | ||
add_library(${TARGET_NAME}_test_static STATIC ${TEST_SOURCES} ${HEADERS}) | ||
target_compile_definitions(${TARGET_NAME}_test_static | ||
PUBLIC -DINTEGER_LOW_P | ||
-DUSE_STATIC_IE) | ||
|
||
install(FILES "${GNA_KERNEL_LIBRARY}" | ||
DESTINATION ${IE_CPACK_IE_DIR}/external/gna/lib | ||
COMPONENT gna) | ||
set_target_properties(${TARGET_NAME}_test_static PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}_test_static) |
Oops, something went wrong.