Skip to content

Commit

Permalink
Update speech_Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
kbruniec committed Apr 29, 2021
1 parent 654d0f5 commit 9dca402
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inference-engine/include/gna/gna_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions inference-engine/samples/speech_sample/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 23 additions & 0 deletions inference-engine/samples/speech_sample/speech_sample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

Expand Down Expand Up @@ -109,6 +126,12 @@ DEFINE_string(m, "", model_message);
/// \brief device the target device to infer on (default CPU) <br>
DEFINE_string(d, "CPU", target_device_message);

/// \brief GNA execution target <br>
DEFINE_string(exec_target, "", execution_target_message);

/// \brief GNA compile target <br>
DEFINE_string(compile_target, "", compile_target_message);

/// \brief Enable per-layer performance report
DEFINE_bool(pc, false, performance_counter_message);

Expand Down

0 comments on commit 9dca402

Please sign in to comment.