From d52462d6c59fa8d57af5bd33a261797fa42fb06c Mon Sep 17 00:00:00 2001 From: Dongju Chae Date: Thu, 19 Aug 2021 11:13:16 +0900 Subject: [PATCH] [Plugin] Rename nnstreamer subplugin This patch renames nnstreamer subplugin from srnpu to trix-engine. Signed-off-by: Dongju Chae --- docs/markdown/TizenSample.md | 9 ++-- packaging/npu-engine.spec | 10 ++-- plugins/nnstreamer/meson.build | 12 ++--- ...ilter_srnpu.cc => tensor_filter_trix_engine.cc} | 59 +++++++++++----------- ..._filter_srnpu.h => tensor_filter_trix_engine.h} | 22 ++++---- 5 files changed, 57 insertions(+), 55 deletions(-) rename plugins/nnstreamer/{tensor_filter_srnpu.cc => tensor_filter_trix_engine.cc} (79%) rename plugins/nnstreamer/{tensor_filter_srnpu.h => tensor_filter_trix_engine.h} (82%) diff --git a/docs/markdown/TizenSample.md b/docs/markdown/TizenSample.md index 194136e..cf7919b 100644 --- a/docs/markdown/TizenSample.md +++ b/docs/markdown/TizenSample.md @@ -16,7 +16,7 @@ The sample application requires Tizen emulator 6.0 or more. The mandatory packages to be installed are as follows. - `libmrpsim`: NPU Simulator ([Repo](https://github.sec.samsung.net/AIP/SIM_TrinityVision2)) - `npu-engine`: NPU User Library ([Repo](https://github.sec.samsung.net/AIP/NPU_SystemService)) -- `nnstreamer-srnpu`: NNStreamer Tensor Filter Subplugin for SRNPU ([Repo](https://github.sec.samsung.net/AIP/NPU_SystemService/tree/tizen/plugins/nnstreamer)) +- `nnstreamer-trix-engine`: NNStreamer Tensor Filter Subplugin for TRIx Engine ([Repo](https://github.sec.samsung.net/AIP/NPU_SystemService/tree/tizen/plugins/nnstreamer)) Note that before such packages are shipped to official emulator images, you should download the pre-built packages in [here](https://art.sec.samsung.net/artifactory/aip_generic/RPMS_FOR_TIZEN_EMUL/) and customize your emulator image. Please refer to [here](https://github.sec.samsung.net/AIP/TRIV2_TIZEN_SAMPLE) for detail. @@ -29,9 +29,10 @@ $ sdb devices List of devices attached emulator-26101 device m-0405-1 $ ls -1 RPMS -libmrpsim-3.8.67-0.i686.rpm -nnstreamer-srnpu-2.3.15-0.i686.rpm -npu-engine-2.3.15-0.i686.rpm +libmrpsim-3.8.71-0.i686.rpm +nnstreamer-trix-engine-2.3.16-0.i686.rpm +npu-engine-2.3.16-0.i686.rpm +npu-engine-utils-2.3.16-0.i686.rpm $ bash install.sh ... ``` diff --git a/packaging/npu-engine.spec b/packaging/npu-engine.spec index 679aec8..fd7ba1b 100644 --- a/packaging/npu-engine.spec +++ b/packaging/npu-engine.spec @@ -148,15 +148,15 @@ Reference implementation of Tizen NPU Manager TRIV2 plugin, including a dummy NP %endif %if 0%{?nns_plugin} -%package -n nnstreamer-srnpu +%package -n nnstreamer-trix-engine Summary: NNStreamer subplugin for SR-NPU device family Requires: npu-engine Requires: nnstreamer -%description -n nnstreamer-srnpu -Reference implementation of NNStreamer filter subplugin for SR-NPU (for now, TRIV2 only). -%files -n nnstreamer-srnpu +%description -n nnstreamer-trix-engine +Reference implementation of NNStreamer filter subplugin for SR TRIx devices (for now, TRIV2 only). +%files -n nnstreamer-trix-engine %manifest npu-engine.manifest -%{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_srnpu.so +%{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_trix-engine.so %endif %changelog diff --git a/plugins/nnstreamer/meson.build b/plugins/nnstreamer/meson.build index bdd62f7..fa68246 100644 --- a/plugins/nnstreamer/meson.build +++ b/plugins/nnstreamer/meson.build @@ -6,9 +6,9 @@ gmodule_dep = dependency('gmodule-2.0') gst_dep = dependency('gstreamer-' + gst_api_verision) nnstreamer_dep = dependency('nnstreamer') -srnpu_inc = include_directories('.') -srnpu_sources = [ - 'tensor_filter_srnpu.cc' +trix_engine_inc = include_directories('.') +trix_engine_sources = [ + 'tensor_filter_trix_engine.cc' ] base_deps = [ @@ -24,9 +24,9 @@ if target_platform == 'tizen' base_deps += dependency('dlog') endif -srnpu_shared = shared_library('nnstreamer_filter_srnpu', - sources : srnpu_sources, - include_directories : [ne_common_inc, ne_host_inc, srnpu_inc], +trix_engine_shared = shared_library('nnstreamer_filter_trix-engine', + sources : trix_engine_sources, + include_directories : [ne_common_inc, ne_host_inc, trix_engine_inc], dependencies : [base_deps, iniparser_dep], link_with : ne_library_shared, install: true, diff --git a/plugins/nnstreamer/tensor_filter_srnpu.cc b/plugins/nnstreamer/tensor_filter_trix_engine.cc similarity index 79% rename from plugins/nnstreamer/tensor_filter_srnpu.cc rename to plugins/nnstreamer/tensor_filter_trix_engine.cc index 11f4eb0..0952568 100644 --- a/plugins/nnstreamer/tensor_filter_srnpu.cc +++ b/plugins/nnstreamer/tensor_filter_trix_engine.cc @@ -4,30 +4,30 @@ * Copyright (C) 2020 Dongju Chae */ /** - * @file tensor_filter_srnpu.cc + * @file tensor_filter_trix_engine.cc * @date 20 Jan 2020 - * @brief NNStreamer tensor-filter subplugin for srnpu devices + * @brief NNStreamer tensor-filter subplugin for TRIx devices * @see http://github.com/nnstreamer/nnstreamer * @see https://github.sec.samsung.net/AIP/NPU_SystemService * @author Dongju Chae * @bug No known bugs except for NYI items */ -#include +#include using namespace std; namespace nnstreamer { -void init_filter_srnpu (void) __attribute__ ((constructor)); -void fini_filter_srnpu (void) __attribute__ ((destructor)); +void init_filter_trix_engine (void) __attribute__ ((constructor)); +void fini_filter_trix_engine (void) __attribute__ ((destructor)); -TensorFilterSRNPU *TensorFilterSRNPU::registered = nullptr; -const char *TensorFilterSRNPU::name = "srnpu"; -const accl_hw TensorFilterSRNPU::hw_list[] = {ACCL_NPU_SR}; -const int TensorFilterSRNPU::num_hw = 1; +TensorFilterTRIxEngine *TensorFilterTRIxEngine::registered = nullptr; +const char *TensorFilterTRIxEngine::name = "trix-engine"; +const accl_hw TensorFilterTRIxEngine::hw_list[] = {ACCL_NPU_SR}; +const int TensorFilterTRIxEngine::num_hw = 1; -TensorFilterSRNPU::TensorFilterSRNPU () +TensorFilterTRIxEngine::TensorFilterTRIxEngine () : dev_type_ (NPUCOND_CONN_UNKNOWN), dev_ (nullptr), model_path_ (nullptr), @@ -39,7 +39,7 @@ TensorFilterSRNPU::TensorFilterSRNPU () gst_tensors_info_init (addressof (output_info_)); } -TensorFilterSRNPU::~TensorFilterSRNPU () { +TensorFilterTRIxEngine::~TensorFilterTRIxEngine () { g_free (model_path_); g_free (model_meta_); @@ -53,12 +53,12 @@ TensorFilterSRNPU::~TensorFilterSRNPU () { } tensor_filter_subplugin & -TensorFilterSRNPU::getEmptyInstance () { - return *(new TensorFilterSRNPU ()); +TensorFilterTRIxEngine::getEmptyInstance () { + return *(new TensorFilterTRIxEngine ()); } void -TensorFilterSRNPU::configure_instance (const GstTensorFilterProperties *prop) { +TensorFilterTRIxEngine::configure_instance (const GstTensorFilterProperties *prop) { if (!prop->model_files[0] || prop->model_files[0][0] == '\0') { ml_loge ("Unable to find a model filepath given\n"); throw invalid_argument ("Unable to find a model filepath given"); @@ -167,7 +167,7 @@ convert_data_type (const tensor_type &type) { } void -TensorFilterSRNPU::set_data_info (tensors_data_info *in_info, tensors_data_info *out_info) { +TensorFilterTRIxEngine::set_data_info (tensors_data_info *in_info, tensors_data_info *out_info) { in_info->num_info = model_meta_->input_seg_num; for (uint32_t idx = 0; idx < in_info->num_info; ++idx) { @@ -184,7 +184,7 @@ TensorFilterSRNPU::set_data_info (tensors_data_info *in_info, tensors_data_info } void -TensorFilterSRNPU::feed_input_data (const GstTensorMemory *input, input_buffers *input_buf) { +TensorFilterTRIxEngine::feed_input_data (const GstTensorMemory *input, input_buffers *input_buf) { input_buf->num_buffers = model_meta_->input_seg_num; for (uint32_t idx = 0; idx < input_buf->num_buffers; ++idx) { @@ -195,7 +195,8 @@ TensorFilterSRNPU::feed_input_data (const GstTensorMemory *input, input_buffers } void -TensorFilterSRNPU::extract_output_data (const output_buffers *output_buf, GstTensorMemory *output) { +TensorFilterTRIxEngine::extract_output_data (const output_buffers *output_buf, + GstTensorMemory *output) { /* internal logic error */ assert (output_buf->num_buffers == model_meta_->output_seg_num); @@ -206,7 +207,7 @@ TensorFilterSRNPU::extract_output_data (const output_buffers *output_buf, GstTen } void -TensorFilterSRNPU::invoke (const GstTensorMemory *input, GstTensorMemory *output) { +TensorFilterTRIxEngine::invoke (const GstTensorMemory *input, GstTensorMemory *output) { int req_id; int status; @@ -248,7 +249,7 @@ TensorFilterSRNPU::invoke (const GstTensorMemory *input, GstTensorMemory *output } void -TensorFilterSRNPU::getFrameworkInfo (GstTensorFilterFrameworkInfo &info) { +TensorFilterTRIxEngine::getFrameworkInfo (GstTensorFilterFrameworkInfo &info) { info.name = name; info.allow_in_place = FALSE; info.allocate_in_invoke = TRUE; @@ -259,8 +260,8 @@ TensorFilterSRNPU::getFrameworkInfo (GstTensorFilterFrameworkInfo &info) { } int -TensorFilterSRNPU::getModelInfo (model_info_ops ops, GstTensorsInfo &in_info, - GstTensorsInfo &out_info) { +TensorFilterTRIxEngine::getModelInfo (model_info_ops ops, GstTensorsInfo &in_info, + GstTensorsInfo &out_info) { if (ops != GET_IN_OUT_INFO) { return -ENOENT; } @@ -271,30 +272,30 @@ TensorFilterSRNPU::getModelInfo (model_info_ops ops, GstTensorsInfo &in_info, } int -TensorFilterSRNPU::eventHandler (event_ops ops, GstTensorFilterFrameworkEventData &data) { +TensorFilterTRIxEngine::eventHandler (event_ops ops, GstTensorFilterFrameworkEventData &data) { return -ENOENT; } void -TensorFilterSRNPU::init_filter_srnpu () { - registered = tensor_filter_subplugin::register_subplugin (); +TensorFilterTRIxEngine::init_filter_trix_engine () { + registered = tensor_filter_subplugin::register_subplugin (); } void -TensorFilterSRNPU::fini_filter_srnpu () { +TensorFilterTRIxEngine::fini_filter_trix_engine () { /* internal logic error */ assert (registered != nullptr); tensor_filter_subplugin::unregister_subplugin (registered); } void -init_filter_srnpu () { - TensorFilterSRNPU::init_filter_srnpu (); +init_filter_trix_engine () { + TensorFilterTRIxEngine::init_filter_trix_engine (); } void -fini_filter_srnpu () { - TensorFilterSRNPU::fini_filter_srnpu (); +fini_filter_trix_engine () { + TensorFilterTRIxEngine::fini_filter_trix_engine (); } } /* namespace nnstreamer */ diff --git a/plugins/nnstreamer/tensor_filter_srnpu.h b/plugins/nnstreamer/tensor_filter_trix_engine.h similarity index 82% rename from plugins/nnstreamer/tensor_filter_srnpu.h rename to plugins/nnstreamer/tensor_filter_trix_engine.h index 71a5f2f..ae9d140 100644 --- a/plugins/nnstreamer/tensor_filter_srnpu.h +++ b/plugins/nnstreamer/tensor_filter_trix_engine.h @@ -4,16 +4,16 @@ * Copyright (C) 2020 Dongju Chae */ /** - * @file tensor_filter_subplugin_srnpu.h + * @file tensor_filter_subplugin_trix_engine.h * @date 20 Jan 2020 - * @brief NNStreamer tensor-filter subplugin srnpu header + * @brief NNStreamer tensor-filter subplugin trix_engine header * @see https://github.com/nnsuite/nnstreamer * @see https://github.sec.samsung.net/AIP/NPU_SystemService * @author Dongju Chae * @bug No known bugs */ -#ifndef __TENSOR_FILTER_SUBPLUGIN_SRNPU_H__ +#ifndef __TENSOR_FILTER_SUBPLUGIN_TRIxEngine_H__ /* npu-engine headers */ #include @@ -25,7 +25,7 @@ #if defined(__TIZEN__) #include -#define TAG_NAME "nnstreamer_srnpu" +#define TAG_NAME "nnstreamer_trix_engine" #define ml_logi(...) dlog_print (DLOG_INFO, TAG_NAME, __VA_ARGS__) #define ml_logw(...) dlog_print (DLOG_WARN, TAG_NAME, __VA_ARGS__) #define ml_loge(...) dlog_print (DLOG_ERROR, TAG_NAME, __VA_ARGS__) @@ -41,10 +41,10 @@ namespace nnstreamer { -class TensorFilterSRNPU : public tensor_filter_subplugin { +class TensorFilterTRIxEngine : public tensor_filter_subplugin { public: - TensorFilterSRNPU (); - ~TensorFilterSRNPU (); + TensorFilterTRIxEngine (); + ~TensorFilterTRIxEngine (); /* mandatory methods */ tensor_filter_subplugin &getEmptyInstance (); @@ -55,15 +55,15 @@ class TensorFilterSRNPU : public tensor_filter_subplugin { int eventHandler (event_ops ops, GstTensorFilterFrameworkEventData &data); /* static methods */ - static void init_filter_srnpu (); - static void fini_filter_srnpu (); + static void init_filter_trix_engine (); + static void fini_filter_trix_engine (); private: void set_data_info (tensors_data_info *in_info, tensors_data_info *out_info); void feed_input_data (const GstTensorMemory *input, input_buffers *input_buf); void extract_output_data (const output_buffers *output_buf, GstTensorMemory *output); - static TensorFilterSRNPU *registered; + static TensorFilterTRIxEngine *registered; static const char *name; static const accl_hw hw_list[]; static const int num_hw; @@ -84,4 +84,4 @@ class TensorFilterSRNPU : public tensor_filter_subplugin { } /* namespace nnstreamer */ -#endif /* __TENSOR_FILTER_SUBPLUGIN_H_SRNPU_ */ +#endif /* __TENSOR_FILTER_TRIxEngine_SUBPLUGIN_H__ */ -- 2.7.4