[GNA] New flags to select GNA target generation (#5429)
* New flags for GNA trget * Add new flags to configuration * Update utest * Update speech_Sample * Add unit tests * Guard for wrong values * Use gna execution target as consistent device * Apply review
This commit is contained in:
1 parent
edfec9171f
commit
7c07c6154b
9 files changed
+157
-38
No files matched your search
@@ -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);
|
||||
|
||||
@@ -27,6 +27,20 @@ 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. Specify GNA execution target generation. "
|
||||
"May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. "
|
||||
"By default, generation corresponds to the GNA HW available in the system "
|
||||
"or the latest fully supported generation by the software. "
|
||||
"See the GNA Plugin's GNA_EXEC_TARGET config option description.";
|
||||
|
||||
/// @brief message for execution target
|
||||
static const char compile_target_message[] = "Optional. Specify GNA compile target generation. "
|
||||
"May be one of GNA_TARGET_2_0, GNA_TARGET_3_0. "
|
||||
"By default, generation corresponds to the GNA HW available in the system "
|
||||
"or the latest fully supported generation by the software. "
|
||||
"See the GNA Plugin's GNA_COMPILE_TARGET config option description.";
|
||||
|
||||
/// @brief message for performance counters
|
||||
static const char performance_counter_message[] = "Optional. Enables per-layer performance report.";
|
||||
|
||||
@@ -109,6 +123,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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user