Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / include / gna / gna_config.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 /**
6  * @brief A header that defines advanced related properties for VPU plugins.
7  * These properties should be used in SetConfig() and LoadNetwork() methods of plugins
8  *
9  * @file vpu_plugin_config.hpp
10  */
11
12 #pragma once
13
14 #include <string>
15 #include "ie_plugin_config.hpp"
16
17 namespace InferenceEngine {
18
19 namespace GNAConfigParams {
20
21 #define GNA_CONFIG_KEY(name) InferenceEngine::GNAConfigParams::_CONFIG_KEY(GNA_##name)
22 #define GNA_CONFIG_VALUE(name) InferenceEngine::GNAConfigParams::GNA_##name
23
24 #define DECLARE_GNA_CONFIG_KEY(name) DECLARE_CONFIG_KEY(GNA_##name)
25 #define DECLARE_GNA_CONFIG_VALUE(name) DECLARE_CONFIG_VALUE(GNA_##name)
26
27 /**
28 * @brief Scale factor that is calculated by user, in order to use static quantisation feature
29 * This option should be used with floating point value serialized to string with decimal separator equals to . (dot)
30 * @details For multiple input case, individual scale factors can be passed, using KEY_GNA_SCALE_FACTOR[_input_layer_name]
31 * where input_layer can be obtained from from CNNNetwork::GetInputsInfo
32 */
33 DECLARE_GNA_CONFIG_KEY(SCALE_FACTOR);
34
35 /**
36 * @brief By default gna api work in Int16 precision, however this can be adjusted if necessary,
37 * currently supported values are I16, I8
38 */
39 DECLARE_GNA_CONFIG_KEY(PRECISION);
40
41
42 /**
43 * @brief if turned on, dump GNA firmware model into specified file
44 */
45 DECLARE_GNA_CONFIG_KEY(FIRMWARE_MODEL_IMAGE);
46
47 /**
48 * @brief GNA proc_type setting that should be one of GNA_AUTO, GNA_HW, GNA_SW, GNA_SW_EXACT
49 */
50 DECLARE_GNA_CONFIG_KEY(DEVICE_MODE);
51
52 DECLARE_GNA_CONFIG_VALUE(AUTO);
53 DECLARE_GNA_CONFIG_VALUE(HW);
54 DECLARE_GNA_CONFIG_VALUE(SW);
55 DECLARE_GNA_CONFIG_VALUE(SW_EXACT);
56
57 /**
58 * @brief if enabled produced minimum memory footprint for loaded network in GNA memory, default value is YES
59 */
60 DECLARE_GNA_CONFIG_KEY(COMPACT_MODE);
61
62 /**
63 * @brief The option to enable/disable uniformly distributed PWL algorithm.
64 * By default (in case of NO value set) the optimized algorithm called "Recursive Descent Algorithm for Finding
65 * the Optimal Minimax Piecewise Linear Approximation of Convex Functions is used.
66 * If value is YES then simple uniform distribution used to create PWL approximation of activation functions
67 * Uniform distribution usually gives poor approximation with same number of segments
68 */
69 DECLARE_GNA_CONFIG_KEY(PWL_UNIFORM_DESIGN);
70
71 /**
72 * @brief By default, the GNA plugin uses one worker thread for inference computations.
73 * This parameter allows you to create up to 127 threads for software modes.
74 *
75 * Note that multithreading mode does not guarantee the same computation order as order
76 * of issuing. Additionally, in this case, software modes do not implement any serializations.
77 */
78 DECLARE_GNA_CONFIG_KEY(LIB_N_THREADS);
79 }  // namespace GNAConfigParams
80 }  // namespace InferenceEngine