diff options
Diffstat (limited to 'python/openvino/runtime/dla_benchmark/CMakeLists.txt')
| -rw-r--r-- | python/openvino/runtime/dla_benchmark/CMakeLists.txt | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/python/openvino/runtime/dla_benchmark/CMakeLists.txt b/python/openvino/runtime/dla_benchmark/CMakeLists.txt new file mode 100644 index 0000000..3a50459 --- /dev/null +++ b/python/openvino/runtime/dla_benchmark/CMakeLists.txt @@ -0,0 +1,82 @@ +# Copyright (C) 2018-2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +set (TARGET_NAME "dla_benchmark") + +if (CMAKE_CXX_COMPILER_ID MATCHES MSVC) + set(CMAKE_CXX_STANDARD 20) +else() + set (CMAKE_CXX_STANDARD 14) +endif() +set (CMAKE_CXX_STANDARD_REQUIRED ON) +if (NOT WIN32) + if (NOT("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) + set (CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}") + endif() +endif() + +file (GLOB MAIN_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../common/utils/src/*.cpp +) + +file (GLOB MAIN_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp +) + +# Create named folders for the sources within the .vcproj +# Empty name lists them directly under the .vcproj +source_group("src" FILES ${MAIN_SRC}) +source_group("include" FILES ${MAIN_HEADERS}) + +if (DE10_AGILEX) + add_definitions(-DDE10_AGILEX) +endif() + +# Find OpenCV components if exist +find_package(OpenCV COMPONENTS core highgui imgcodecs imgproc videoio REQUIRED) + +# Create library file from sources. +add_executable(${TARGET_NAME} ${MAIN_SRC} ${MAIN_HEADERS}) + +# For FPGA plugin configs and properties. +target_include_directories(${TARGET_NAME} PRIVATE + "$ENV{COREDLA_ROOT}/dla_plugin/inc/" + "$ENV{COREDLA_ROOT}/util/inc/" +) + +if (NOT WIN32) + set (LIB_DL dl) +endif() + +target_link_libraries(${TARGET_NAME} PRIVATE + openvino::runtime + openvino_dev_api + ${OpenCV_LIBRARIES} + coreDLAHeteroPlugin + format_reader + ie_samples_utils +) + +if (NOT WIN32) + target_link_libraries(${TARGET_NAME} PRIVATE ${LIB_DL} pthread) +endif() + +set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib") + +# For libcoreDlaRuntimePlugin.so - typically specified by $COREDLA_ROOT/runtime/plugins.xml +set_target_properties(${TARGET_NAME} PROPERTIES BUILD_RPATH "\$ORIGIN/..") + +# Enable high graph logging by defining its macro +# Change to add_compile_definitions() once we move to cmake >= 3.12 +if (DLA_ENABLE_LOGGING) + target_compile_definitions(${TARGET_NAME} PRIVATE -DENABLE_HG_LOGGING) +endif() + +# Ensure number of inference request is 1 when using the system-console plugin +if (SYSTEM_CONSOLE_PLATFORM) + target_compile_definitions(${TARGET_NAME} PRIVATE -DMAX_NUM_INFERENCE_REQUEST=1) +endif() + +install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION "dla/bin" COMPONENT DEMO) |
