From 68caf32806d8b1d7c917d0dc17c31b3f2abf60be Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Fri, 11 Sep 2020 16:20:22 +0900 Subject: [PATCH] Add ARMNN and TFLITE backend support Change-Id: I2fde5e660950a3e2d9d2d1722c351cdd448f86a4 Signed-off-by: Inki Dae --- src/inference_engine_mlapi.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/inference_engine_mlapi.cpp b/src/inference_engine_mlapi.cpp index 29913e5..1a191b8 100644 --- a/src/inference_engine_mlapi.cpp +++ b/src/inference_engine_mlapi.cpp @@ -63,7 +63,7 @@ namespace MLAPIImpl inference_backend_type_e type = *(static_cast(data)); - if (INFERENCE_BACKEND_ONE != type && INFERENCE_BACKEND_MLAPI != type) { + if (INFERENCE_BACKEND_NONE >= type || INFERENCE_BACKEND_MAX <= type) { LOGE("Invalid backend type."); return INFERENCE_ENGINE_ERROR_NOT_SUPPORTED; } @@ -139,7 +139,14 @@ namespace MLAPIImpl model_str += "," + model_paths[1]; break; case INFERENCE_BACKEND_ONE: - nnfw_type = ML_NNFW_TYPE_NNFW; + case INFERENCE_BACKEND_ARMNN: + case INFERENCE_BACKEND_TFLITE: + if (mPluginType == INFERENCE_BACKEND_ONE) + nnfw_type = ML_NNFW_TYPE_NNFW; + if (mPluginType == INFERENCE_BACKEND_ARMNN) + nnfw_type = ML_NNFW_TYPE_ARMNN; + if (mPluginType == INFERENCE_BACKEND_TFLITE) + nnfw_type = ML_NNFW_TYPE_TENSORFLOW_LITE; if (access(model_str.c_str(), R_OK)) { LOGE("model file path in [%s]", model_str.c_str()); -- 2.7.4