[openvino/hw] Update openvino supported HW
authorParichay Kapoor <pk.kapoor@samsung.com>
Tue, 11 Feb 2020 10:10:54 +0000 (19:10 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 4 Mar 2020 04:22:08 +0000 (13:22 +0900)
Updated the list of HWs supported with openvino
Providing "true:npu" should also work along with "true:npu.movidius"
Providing specific movidius accelerator works
However, just providing a generic npu should also default to movidius

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_openvino.cc
ext/nnstreamer/tensor_filter/tensor_filter_openvino.hh

index c111797..c1abcdc 100644 (file)
@@ -42,6 +42,7 @@ void fini_filter_openvino (void) __attribute__ ((destructor));
 
 std::map<accl_hw, std::string> TensorFilterOpenvino::_nnsAcclHwToOVDevMap = {
     {ACCL_CPU, "CPU"},
+    {ACCL_NPU, "MYRIAD"},
     {ACCL_NPU_MOVIDIUS, "MYRIAD"},
 };
 
@@ -617,12 +618,27 @@ ov_open (const GstTensorFilterProperties * prop, void **private_data)
   return tfOv->loadModel (accelerator);
 }
 
+/**
+ * @brief The optional callback for GstTensorFilterFramework
+ * @param[in] hw backend accelerator hardware
+ * @return 0 if supported. -errno if not supported.
+ */
+static int
+ov_checkAvailability (accl_hw hw)
+{
+  if (g_strv_contains (openvino_accl_support, get_accl_hw_str (hw)))
+    return 0;
+
+  return -ENOENT;
+}
+
 static gchar filter_subplugin_openvino[] = "openvino";
 
 static GstTensorFilterFramework NNS_support_openvino = {
   .version = GST_TENSOR_FILTER_FRAMEWORK_V0,
   .open = ov_open,
   .close = ov_close,
+  .checkAvailability = ov_checkAvailability,
 };
 
 /**
index e39e038..4748758 100644 (file)
@@ -47,6 +47,7 @@
 
 const gchar *openvino_accl_support[] = {
   ACCL_CPU_STR,
+  ACCL_NPU_STR,
   ACCL_NPU_MOVIDIUS_STR,
   NULL
 };