From 9dca40279a6653f11a1251f877641024b71ccccc Mon Sep 17 00:00:00 2001 From: Krzysztof Bruniecki Date: Thu, 29 Apr 2021 09:17:48 +0200 Subject: [PATCH] Update speech_Sample --- inference-engine/include/gna/gna_config.hpp | 3 ++- .../samples/speech_sample/main.cpp | 2 ++ .../samples/speech_sample/speech_sample.hpp | 23 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/inference-engine/include/gna/gna_config.hpp b/inference-engine/include/gna/gna_config.hpp index 81e9ac38da8ddc..3855a424ee36bc 100644 --- a/inference-engine/include/gna/gna_config.hpp +++ b/inference-engine/include/gna/gna_config.hpp @@ -83,7 +83,8 @@ DECLARE_GNA_CONFIG_VALUE(AVX2_EXACT); If GNA HW is present, use the option corresponding to this HW. If HW is not present, use the latest supported generation (i.e., GNA_TARGET_3_0 for 2021.4) The "latest supported generation" should be the latest available HW. - For example, for 2021.4 (GNA_TARGET_3_0 is the latest HW), we should support 3.5 options even if they are supported by the library. + For example, for 2021.4 (GNA_TARGET_3_0 is the latest HW), GNA Plugin does not support features even if they are supported by the GNA library + if not available in the current GNA HW. */ DECLARE_GNA_CONFIG_KEY(EXEC_TARGET); diff --git a/inference-engine/samples/speech_sample/main.cpp b/inference-engine/samples/speech_sample/main.cpp index d6b79c76f9172c..3c883e3bf643aa 100644 --- a/inference-engine/samples/speech_sample/main.cpp +++ b/inference-engine/samples/speech_sample/main.cpp @@ -760,6 +760,8 @@ int main(int argc, char* argv[]) { gnaPluginConfig[GNAConfigParams::KEY_GNA_PRECISION] = "I16"; } + gnaPluginConfig[GNAConfigParams::KEY_GNA_EXEC_TARGET] = FLAGS_exec_target; + gnaPluginConfig[GNAConfigParams::KEY_GNA_COMPILE_TARGET] = FLAGS_compile_target; gnaPluginConfig[GNAConfigParams::KEY_GNA_LIB_N_THREADS] = std::to_string((FLAGS_cw_r > 0 || FLAGS_cw_l > 0) ? 1 : FLAGS_nthreads); gnaPluginConfig[GNA_CONFIG_KEY(COMPACT_MODE)] = CONFIG_VALUE(NO); gnaPluginConfig[GNA_CONFIG_KEY(PWL_MAX_ERROR_PERCENT)] = std::to_string(FLAGS_pwl_me); diff --git a/inference-engine/samples/speech_sample/speech_sample.hpp b/inference-engine/samples/speech_sample/speech_sample.hpp index a2c7f3aee6ce3d..e445c36126d93e 100644 --- a/inference-engine/samples/speech_sample/speech_sample.hpp +++ b/inference-engine/samples/speech_sample/speech_sample.hpp @@ -27,6 +27,23 @@ static const char target_device_message[] = "Optional. Specify a target device t "below. " "The sample will look for a suitable plugin for device specified."; +/// @brief message for execution target +static const char execution_target_message[] = "Optional (aka, GNA_EXEC_TARGET). Overrides GNA execution target generation. " + "Should be one of GNA_TARGET_2_0, GNA_TARGET_3_0 or empty. " + "When empty default value assumed: " + "If GNA HW is present, use the option corresponding to this HW. " + "If HW is not present, use the latest supported generation (i.e., GNA_TARGET_3_0 for 2021.4) " + "The \"latest supported generation\" should be the latest available HW. " + "For example, for 2021.4 (GNA_TARGET_3_0 is the latest HW), " + "GNA Plugin does not support features even if they are supported by the GNA library " + "if not available in the current GNA HW."; + +/// @brief message for execution target +static const char compile_target_message[] = "Optional (aka, GNA_COMPILE_TARGET). Overrides GNA execution target generation. " + "Should be one of GNA_TARGET_2_0, GNA_TARGET_3_0 or empty. " + "When empty default value assumed: " + "same as GNA_EXEC_TARGET"; + /// @brief message for performance counters static const char performance_counter_message[] = "Optional. Enables per-layer performance report."; @@ -109,6 +126,12 @@ DEFINE_string(m, "", model_message); /// \brief device the target device to infer on (default CPU)
DEFINE_string(d, "CPU", target_device_message); +/// \brief GNA execution target
+DEFINE_string(exec_target, "", execution_target_message); + +/// \brief GNA compile target
+DEFINE_string(compile_target, "", compile_target_message); + /// \brief Enable per-layer performance report DEFINE_bool(pc, false, performance_counter_message);