mv_inference: pass inference target device correctly
authorInki Dae <inki.dae@samsung.com>
Wed, 5 Feb 2020 08:28:51 +0000 (17:28 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 14 Apr 2020 00:40:31 +0000 (09:40 +0900)
Change-Id: If8c901555bbb8555bac8bf9f67a182f442cdbfa6
Signed-off-by: Inki Dae <inki.dae@samsung.com>
include/mv_inference_type.h
mv_inference/inference/src/Inference.cpp

index 780c84d591e32d89cb4d02488e5510fdee3e6926..11ca8c2eb9822640bb816261939a7fe632d36858 100644 (file)
@@ -54,11 +54,11 @@ typedef enum {
  *
  */
 typedef enum {
-    MV_INFERENCE_TARGET_NONE = -1, /**< None */
-    MV_INFERENCE_TARGET_CPU,       /**< CPU */
-    MV_INFERENCE_TARGET_GPU,       /**< GPU*/
-    MV_INFERENCE_TARGET_CUSTOM,    /**< CUSTOM*/
-    MV_INFERENCE_TARGET_MAX        /**< Target MAX */
+    MV_INFERENCE_TARGET_NONE   = 0, /**< None */
+    MV_INFERENCE_TARGET_CPU    = 1 << 0,    /**< CPU */
+    MV_INFERENCE_TARGET_GPU    = 1 << 1,    /**< GPU*/
+    MV_INFERENCE_TARGET_CUSTOM = 1 << 2,    /**< CUSTOM*/
+    MV_INFERENCE_TARGET_MAX    = 1 << 3     /**< Target MAX */
 } mv_inference_target_type_e;
 
 /**
index 6010a97aba4516e1da8b181d9a805828f360d46a..bc54145b5ccd0dd6b21959b5214ae283e5ab221d 100644 (file)
@@ -176,6 +176,10 @@ int Inference::ConfigureEngine(const mv_inference_backend_type_e backendType,
                LOGE("%s type is not supported", (backend.first).c_str());
                return MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT;
        }
+
+    LOGI("backend engine : %d", backendType);
+    LOGI("target device : %d", targetType);
+
        mConfig.mBackedType = backendType;
        mConfig.mTargetType = (inference_target_type_e)targetType;
 
@@ -220,7 +224,7 @@ int Inference::Prepare()
 
     inference_engine_config config = {
         .backend_name = backendName,
-        .target_devices = INFERENCE_TARGET_CPU,
+        .target_devices = mConfig.mTargetType,
     };
 
     // Create backend class object.