armnn::IRuntime::CreationOptions creation_options;
- // The use of CLTuner is valid only in case of GpuAcc request.
- if (mCLTuner.active && UseGpuAcc()) {
- std::string tune_path = model_paths[0] + ".tune";
-
- // file_path can be set by user. So if file_path is given then
- // user-given path will be passed to a given inference engine.
- // On the other hand, if file_path is empty then default
- // path - "model file path + .tune" - will be passed to the
- // inference engine.
- if (!mCLTuner.file_path.empty())
- tune_path = mCLTuner.file_path;
-
- LOGI("CLTuner tuning file name is %s", tune_path.c_str());
-
- // If CLTuner is read only mode then set INFERENCE_ENGINE_CLTUNER_READ
- // to TuningLevel.
- // Ps. if TuningLevel is INFERENCE_ENGINE_CLTUNER_READ then
- // ARMCL will read a tuned file for inference.
- if (mCLTuner.update == false) {
- LOGI("CLTuner mode is read only.");
- mCLTuner.tuning_mode = INFERENCE_ENGINE_CLTUNER_READ;
- }
+ if (UseGpuAcc()) {
+ // The use of CLTuner is valid only in case of GpuAcc request.
+ if (mCLTuner.active) {
+ std::string tune_path = model_paths[0] + ".tune";
+
+ // file_path can be set by user. So if file_path is given then
+ // user-given path will be passed to a given inference engine.
+ // On the other hand, if file_path is empty then default
+ // path - "model file path + .tune" - will be passed to the
+ // inference engine.
+ if (!mCLTuner.file_path.empty())
+ tune_path = mCLTuner.file_path;
+
+ LOGI("CLTuner tuning file name is %s", tune_path.c_str());
+
+ // If CLTuner is read only mode then set INFERENCE_ENGINE_CLTUNER_READ
+ // to TuningLevel.
+ // Ps. if TuningLevel is INFERENCE_ENGINE_CLTUNER_READ then
+ // ARMCL will read a tuned file for inference.
+ if (mCLTuner.update == false) {
+ LOGI("CLTuner mode is read only.");
+ mCLTuner.tuning_mode = INFERENCE_ENGINE_CLTUNER_READ;
+ }
- creation_options.m_BackendOptions.emplace_back(
- armnn::BackendOptions
- {
- "GpuAcc",
+ creation_options.m_BackendOptions.emplace_back(
+ armnn::BackendOptions
{
- {"TuningLevel", static_cast<int>(ConvertTuningType(mCLTuner.tuning_mode))},
- {"TuningFile", tune_path.c_str()}
+ "GpuAcc",
+ {
+ {"FastMathEnabled", true},
+ {"TuningLevel", static_cast<int>(ConvertTuningType(mCLTuner.tuning_mode))},
+ {"TuningFile", tune_path.c_str()}
+ }
}
- }
- );
+ );
+ } else {
+ creation_options.m_BackendOptions.emplace_back(
+ armnn::BackendOptions
+ {
+ "GpuAcc",
+ {
+ { "FastMathEnabled", true}
+ }
+ }
+ );
+ }
}
if (sRuntime == nullptr) {
#endif
// First parameter is reduceFp32ToFp16, and second one is debug mode.
// In default, reduceFp32ToFp16 is false.
- armnn::OptimizerOptions optimizerOptions(false, graph_debug);
+ armnn::OptimizerOptions optimizerOptions(true, graph_debug);
// Optimize the network for a specific runtime compute device, e.g. CpuAcc, GpuAcc
armnn::IOptimizedNetworkPtr optimizedNet = armnn::Optimize(