)
endif
+if executorch_support_is_available
+ filter_sub_executorch_sources = ['tensor_filter_executorch.cc']
+
+ nnstreamer_filter_executorch_deps = [executorch_support_deps, glib_dep, nnstreamer_single_dep]
+
+ shared_library('nnstreamer_filter_executorch',
+ filter_sub_executorch_sources,
+ dependencies: nnstreamer_filter_executorch_deps,
+ install: true,
+ install_dir: filter_subplugin_install_dir
+ )
+
+ static_library('nnstreamer_filter_executorch',
+ filter_sub_executorch_sources,
+ dependencies: nnstreamer_filter_executorch_deps,
+ install: true,
+ install_dir: filter_subplugin_install_dir
+ )
+endif
+
if onnxruntime_support_is_available
filter_sub_onnxruntime_sources = ['tensor_filter_onnxruntime.cc']
#include <memory>
#include <vector>
+#include <executorch/cmake-out/kernels/portable/portable_ops_lib/RegisterCodegenUnboxedKernelsEverything.cpp>
#include <executorch/extension/data_loader/file_data_loader.h>
#include <executorch/extension/evalue_util/print_evalue.h>
#include <executorch/extension/runner_util/inputs.h>
+#include <executorch/kernels/prim_ops/register_prim_ops.cpp>
#include <executorch/runtime/executor/method.h>
#include <executorch/runtime/executor/program.h>
#include <executorch/runtime/platform/log.h>
namespace nnstreamer
{
-namespace tensor_filter_executorch
+namespace tensorfilter_executorch
{
-extern "C" {
+G_BEGIN_DECLS
+
void init_filter_executorch (void) __attribute__ ((constructor));
void fini_filter_executorch (void) __attribute__ ((destructor));
-}
+
+G_END_DECLS
/**
* @brief tensor-filter-subplugin concrete class for ExecuTorch
/**
* @brief Constructor for executorch subplugin.
*/
-executorch_subplugin::executorch_subplugin ()
- : tensor_filter_subplugin (), configured (false), model_path (nullptr),
- method_name (nullptr)
+executorch_subplugin::executorch_subplugin () : tensor_filter_subplugin ()
{
gst_tensors_info_init (std::addressof (inputInfo));
gst_tensors_info_init (std::addressof (outputInfo));
void
executorch_subplugin::configure_instance (const GstTensorFilterProperties *prop)
{
- /* Already configured */
- if (configured)
- cleanup ();
+ /* get input / output info from properties */
+ gst_tensors_info_copy (std::addressof (inputInfo), std::addressof (prop->input_meta));
+ gst_tensors_info_copy (std::addressof (outputInfo), std::addressof (prop->output_meta));
+
+ runtime_init ();
try {
/* Load network (.pte file) */
void
executorch_subplugin::getFrameworkInfo (GstTensorFilterFrameworkInfo &info)
{
- info = framework_info;
+ info = executorch_subplugin::framework_info;
}
/**
}
-} // namespace tensor_filter_executorch
+} // namespace tensorfilter_executorch
} // namespace nnstreamer
\ No newline at end of file