nnstreamer_filter_nnfw_sources += join_paths(meson.current_source_dir(), s)
endforeach
-
nnstreamer_filter_nnfw_deps = nnfw_runtime_support_deps + [glib_dep, gst_dep, nnstreamer_dep]
+ # Check old function (@todo remove this definition later, nnfw ver >= 1.6.0)
+ if not cc.has_function('nnfw_set_input_tensorinfo', dependencies: nnfw_dep)
+ nnstreamer_filter_nnfw_deps += declare_dependency(compile_args: ['-DNNFW_USE_OLD_API=1'])
+ endif
+
nnfw_plugin_lib = shared_library('nnstreamer_filter_nnfw',
nnstreamer_filter_nnfw_sources,
dependencies: nnstreamer_filter_nnfw_deps,
#define NNFW_SRCN_BACKEND "srcn"
#define NNFW_DEFAULT_BACKEND NNFW_CPU_BACKEND
-/** Maximum rank allowed for tensor dimension */
-#define NNFW_TENSOR_RANK_LIMIT 6
-
static const gchar *nnfw_accl_support[] = {
ACCL_CPU_NEON_STR,
ACCL_CPU_STR,
const GstTensorsInfo * tensors_info, guint tensor_idx)
{
struct nnfw_tensorinfo nnfw_info;
+ NNFW_STATUS status;
gint err;
gint idx;
const GstTensorInfo *info = &tensors_info->info[tensor_idx];
for (idx = nnfw_info.rank - 1; idx >= 0; idx--)
nnfw_info.dims[nnfw_info.rank - idx - 1] = info->dimension[idx];
- for (idx = NNFW_TENSOR_RANK_LIMIT - 1; idx >= nnfw_info.rank; idx--)
+ /** @note Maximum rank expressible with nnfw is 6 (NNFW_MAX_RANK) */
+ for (idx = NNFW_MAX_RANK - 1; idx >= nnfw_info.rank; idx--)
nnfw_info.dims[idx] = 0;
- nnfw_apply_tensorinfo (pdata->session, tensor_idx, nnfw_info);
+#if defined (NNFW_USE_OLD_API)
+ /**
+ * @todo nnfw_apply_tensorinfo() will be deprecated.
+ * Use nnfw_set_input_tensorinfo() later (nnfw ver >= 1.6.0).
+ */
+ status = nnfw_apply_tensorinfo (pdata->session, tensor_idx, nnfw_info);
+#else
+ status = nnfw_set_input_tensorinfo (pdata->session, tensor_idx, &nnfw_info);
+#endif
+ if (status != NNFW_STATUS_NO_ERROR)
+ return -EPERM;
return 0;
}