Add ARMNN and TFLITE backend support
authorInki Dae <inki.dae@samsung.com>
Fri, 11 Sep 2020 07:20:22 +0000 (16:20 +0900)
committerInki Dae <inki.dae@samsung.com>
Fri, 11 Sep 2020 07:54:53 +0000 (16:54 +0900)
Change-Id: I2fde5e660950a3e2d9d2d1722c351cdd448f86a4
Signed-off-by: Inki Dae <inki.dae@samsung.com>
src/inference_engine_mlapi.cpp

index 29913e5..1a191b8 100644 (file)
@@ -63,7 +63,7 @@ namespace MLAPIImpl
                inference_backend_type_e type =
                                *(static_cast<inference_backend_type_e *>(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());