From: Parichay Kapoor Date: Tue, 11 Feb 2020 10:10:54 +0000 (+0900) Subject: [openvino/hw] Update openvino supported HW X-Git-Tag: accepted/tizen/unified/20200318.130449~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd1d68f21e8f476960605456216d4b12ab4f8119;p=platform%2Fupstream%2Fnnstreamer.git [openvino/hw] Update openvino supported HW 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 --- diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_openvino.cc b/ext/nnstreamer/tensor_filter/tensor_filter_openvino.cc index c111797..c1abcdc 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_openvino.cc +++ b/ext/nnstreamer/tensor_filter/tensor_filter_openvino.cc @@ -42,6 +42,7 @@ void fini_filter_openvino (void) __attribute__ ((destructor)); std::map 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, }; /** diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_openvino.hh b/ext/nnstreamer/tensor_filter/tensor_filter_openvino.hh index e39e038..4748758 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_openvino.hh +++ b/ext/nnstreamer/tensor_filter/tensor_filter_openvino.hh @@ -47,6 +47,7 @@ const gchar *openvino_accl_support[] = { ACCL_CPU_STR, + ACCL_NPU_STR, ACCL_NPU_MOVIDIUS_STR, NULL };