Revert "Use ittnotify from thirdparty"
[platform/upstream/dldt.git] / inference-engine / cmake / features_ie.cmake
1 # Copyright (C) 2018-2020 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 include (target_flags)
6 include (options)
7
8 #these options are aimed to optimize build time on development system
9
10 ie_dependent_option (ENABLE_GNA "GNA support for inference engine" ON "NOT APPLE;NOT ANDROID;X86 OR X86_64" OFF)
11
12 ie_dependent_option (ENABLE_CLDNN_TESTS "Enable clDNN unit tests" OFF "ENABLE_CLDNN" OFF)
13
14 ie_dependent_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON "NOT CMAKE_CROSSCOMPILING" OFF)
15
16 # "MKL-DNN library might use MKL-ML or OpenBLAS for gemm tasks: MKL|OPENBLAS|JIT"
17 if (ENABLE_MKL_DNN)
18     if(AARCH64)
19         set(GEMM_DEFAULT "OPENBLAS")
20     else()
21         set(GEMM_DEFAULT "JIT")
22     endif()
23     set(GEMM "${GEMM_DEFAULT}" CACHE STRING "GEMM implementation")
24     set_property(CACHE GEMM PROPERTY STRINGS "MKL" "OPENBLAS" "JIT")
25     list (APPEND IE_OPTIONS GEMM)
26     if (NOT GEMM STREQUAL "MKL" AND
27         NOT GEMM STREQUAL "OPENBLAS" AND
28         NOT GEMM STREQUAL "JIT")
29         message(FATAL_ERROR "GEMM should be set to MKL, OPENBLAS or JIT. Default option is ${GEMM_DEFAULT}")
30     endif()
31 endif()
32
33 # "MKL-DNN library based on OMP or TBB or Sequential implementation: TBB|OMP|SEQ"
34 if(ARM)
35     set(THREADING_DEFAULT "SEQ")
36 else()
37     set(THREADING_DEFAULT "TBB")
38 endif()
39 set(THREADING "${THREADING_DEFAULT}" CACHE STRING "Threading")
40 set_property(CACHE THREADING PROPERTY STRINGS "TBB" "TBB_AUTO" "OMP" "SEQ")
41 list (APPEND IE_OPTIONS THREADING)
42 if (NOT THREADING STREQUAL "TBB" AND
43     NOT THREADING STREQUAL "TBB_AUTO" AND
44     NOT THREADING STREQUAL "OMP" AND
45     NOT THREADING STREQUAL "SEQ")
46     message(FATAL_ERROR "THREADING should be set to TBB, TBB_AUTO, OMP or SEQ. Default option is ${THREADING_DEFAULT}")
47 endif()
48
49 if (ENABLE_GNA)
50     if (UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4)
51         set (DEFAULT_GNA_LIB GNA1)
52     else()
53         set (DEFAULT_GNA_LIB GNA1_1401)
54     endif()
55     set(GNA_LIBRARY_VERSION "${DEFAULT_GNA_LIB}" CACHE STRING "GNAVersion")
56     set_property(CACHE GNA_LIBRARY_VERSION PROPERTY STRINGS "GNA1" "GNA1_1401" "GNA2")
57     list (APPEND IE_OPTIONS GNA_LIBRARY_VERSION)
58     if (NOT GNA_LIBRARY_VERSION STREQUAL "GNA1" AND
59         NOT GNA_LIBRARY_VERSION STREQUAL "GNA1_1401" AND
60         NOT GNA_LIBRARY_VERSION STREQUAL "GNA2")
61         message(FATAL_ERROR "GNA_LIBRARY_VERSION should be set to GNA1, GNA1_1401 or GNA2. Default option is ${DEFAULT_GNA_LIB}")
62     endif()
63 endif()
64
65 ie_option (ENABLE_VPU "vpu targeted plugins for inference engine" ON)
66
67 ie_dependent_option (ENABLE_MYRIAD "myriad targeted plugin for inference engine" ON "ENABLE_VPU" OFF)
68
69 ie_dependent_option (ENABLE_MYRIAD_NO_BOOT "myriad plugin will skip device boot" OFF "ENABLE_MYRIAD" OFF)
70
71 ie_dependent_option (ENABLE_GAPI_TESTS "tests for GAPI kernels" ON "ENABLE_TESTS" OFF)
72
73 ie_dependent_option (GAPI_TEST_PERF "if GAPI unit tests should examine performance" OFF "ENABLE_GAPI_TESTS" OFF)
74
75 ie_dependent_option (ENABLE_MYRIAD_MVNC_TESTS "functional and behavior tests for mvnc api" OFF "ENABLE_TESTS;ENABLE_MYRIAD" OFF)
76
77 ie_dependent_option (ENABLE_DATA "fetch models from testdata repo" ON "ENABLE_FUNCTIONAL_TESTS;NOT ANDROID" OFF)
78
79 ie_dependent_option (ENABLE_SAME_BRANCH_FOR_MODELS "uses same branch for models and for inference engine, if not enabled models are taken from master" OFF "ENABLE_TESTS" OFF)
80
81 ie_dependent_option (ENABLE_BEH_TESTS "tests oriented to check inference engine API corecteness" ON "ENABLE_TESTS" OFF)
82
83 ie_dependent_option (ENABLE_FUNCTIONAL_TESTS "functional tests" ON "ENABLE_TESTS" OFF)
84
85 ie_dependent_option (ENABLE_SAMPLES "console samples are part of inference engine package" ON "NOT MINGW" OFF)
86
87 ie_dependent_option (ENABLE_SPEECH_DEMO "enable speech demo integration" ON "NOT APPLE;NOT ANDROID;X86 OR X86_64" OFF)
88
89 ie_option (ENABLE_FUZZING "instrument build for fuzzing" OFF)
90
91 ie_option (VERBOSE_BUILD "shows extra information about build" OFF)
92
93 ie_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF)
94
95 ie_option (ENABLE_ALTERNATIVE_TEMP "in case of dependency conflict, to avoid modification in master, use local copy of dependency" ON)
96
97 ie_option (ENABLE_OPENCV "enables OpenCV" ON)
98
99 ie_option (ENABLE_PYTHON "enables ie python bridge build" OFF)
100
101 ie_option (ENABLE_C "enables ie c bridge build" ON)
102
103 ie_dependent_option(ENABLE_CPPLINT "Enable cpplint checks during the build" ON "UNIX;NOT ANDROID" OFF)
104
105 ie_dependent_option(ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
106
107 ie_option(ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ON)
108
109 set(IE_EXTRA_PLUGINS "" CACHE STRING "Extra paths for plugins to include into DLDT build tree")
110
111 ie_dependent_option(ENABLE_TBB_RELEASE_ONLY "Only Release TBB libraries are linked to the Inference Engine binaries" ON "THREADING MATCHES TBB;LINUX" OFF)