From da989dc3fb8aa60c96baaec08f63b73d6e598569 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Tue, 29 May 2018 12:51:12 +0900 Subject: [PATCH] [Filter/Main] Revise data type for NNFW plugins - Add input/output dimension get methods - Add NNFW plugin private data Signed-off-by: MyungJoo Ham --- tensor_filter/tensor_filter.c | 1 - tensor_filter/tensor_filter.h | 16 ++++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tensor_filter/tensor_filter.c b/tensor_filter/tensor_filter.c index 775f835..1a209f7 100644 --- a/tensor_filter/tensor_filter.c +++ b/tensor_filter/tensor_filter.c @@ -82,7 +82,6 @@ #include #include "tensor_filter.h" -#include GstTensor_Filter_Framework *tensor_filter_supported[] = { &NNS_support_tensorflow_lite, diff --git a/tensor_filter/tensor_filter.h b/tensor_filter/tensor_filter.h index a535fa4..1a58d62 100644 --- a/tensor_filter/tensor_filter.h +++ b/tensor_filter/tensor_filter.h @@ -58,6 +58,7 @@ #include #include #include +#include G_BEGIN_DECLS @@ -138,11 +139,12 @@ struct _GstTensor_Filter nnfw_type nnfw; gchar *modelFilename; - /* @TODO: replace 4 with the macro defined in the common header / int with the enum */ - uint32_t inputDimension[4]; + uint32_t inputDimension[NNS_TENSOR_RANK_LIMIT]; int inputType; - uint32_t outputDimension[4]; + uint32_t outputDimension[NNS_TENSOR_RANK_LIMIT]; int outputType; + + void *privateData; /**< NNFW plugin's private data is stored here */ }; /* @@ -164,9 +166,11 @@ GType gst_tensor_filter_get_type (void); struct _GstTensor_Filter_Framework { - gchar *name; - gboolean allow_in_place; - int (*invoke_NN)(GstTensor_Filter *filter, void *inputptr, void *outputptr); + gchar *name; /**< Name of the neural network framework, searchable by FRAMEWORK property */ + gboolean allow_in_place; /**< TRUE if InPlace transfer of input-to-output is allowed. Not supported in main, yet */ + int (*invoke_NN)(GstTensor_Filter *filter, void *inputptr, void *outputptr); /**< Mandatory callback. Invoke the given network model. */ + int (*getInputDimension)(GstTensor_Fitler *filter, uint32_t *inputDimension); /**< Optional. Set NULL if not supported. Get dimension of input tensor */ + int (*getOutputDimension)(GstTensor_Filter *filter, uint32_t *outputDimension); /**< Optional. Set NULL if not supported. Get dimension of output tensor */ }; typedef struct _GstTensor_Filter_Framework GstTensor_Filter_Framework; -- 2.7.4