From 13237cebbc83c2e4fb02a9bb15df2aefadb09c9e Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Tue, 11 Jan 2022 20:29:44 +0900 Subject: [PATCH] add custom device capacity for SNPE engine [Version] : 0.4.1-0 [Issue type] : bug fix Added custom device capacity for SNPE engine. SNPE engine supports inference on DSP device. Change-Id: I6561916a7debbb874fb40455437ba7eb6c074a90 Signed-off-by: Inki Dae --- packaging/inference-engine-mlapi.spec | 4 ++-- src/inference_engine_mlapi.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packaging/inference-engine-mlapi.spec b/packaging/inference-engine-mlapi.spec index 8f06c9c..576c91e 100644 --- a/packaging/inference-engine-mlapi.spec +++ b/packaging/inference-engine-mlapi.spec @@ -1,7 +1,7 @@ Name: inference-engine-mlapi Summary: ML Single API backend of NNStreamer for MediaVision -Version: 0.4.0 -Release: 1 +Version: 0.4.1 +Release: 0 Group: Multimedia/Libraries License: Apache-2.0 ExclusiveArch: %{arm} aarch64 diff --git a/src/inference_engine_mlapi.cpp b/src/inference_engine_mlapi.cpp index c5ef761..9cba2da 100644 --- a/src/inference_engine_mlapi.cpp +++ b/src/inference_engine_mlapi.cpp @@ -697,12 +697,19 @@ namespace MLAPIImpl return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER; } - // TODO. flag supported accel device types according to a given ML Single API of nnstreamer backend. - if (mPluginType == INFERENCE_BACKEND_NPU_VIVANTE) { + switch (mPluginType) { + case INFERENCE_BACKEND_NPU_VIVANTE: capacity->supported_accel_devices = INFERENCE_TARGET_CUSTOM; - } else { + break; + case INFERENCE_BACKEND_SNPE: + capacity->supported_accel_devices = INFERENCE_TARGET_GPU | + INFERENCE_TARGET_CPU | + INFERENCE_TARGET_CUSTOM; + break; + default: capacity->supported_accel_devices = INFERENCE_TARGET_GPU | INFERENCE_TARGET_CPU; + break; } LOGI("LEAVE"); -- 2.7.4