From: HyoungjooAhn Date: Mon, 17 Sep 2018 06:39:02 +0000 (+0900) Subject: [Filter] create new structure for multi tensors X-Git-Tag: v0.0.2~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fe862cd6c838565c2ade297d2da757b80e3040c;p=platform%2Fupstream%2Fnnstreamer.git [Filter] create new structure for multi tensors define new structure as a standard unit of data tensor. it will be allocated and used to store tensor data Signed-off-by: HyoungjooAhn --- diff --git a/include/tensor_typedef.h b/include/tensor_typedef.h index 093dc6f..bfca16b 100644 --- a/include/tensor_typedef.h +++ b/include/tensor_typedef.h @@ -39,7 +39,8 @@ * The current version supports NNS_UINT8 only as video-input. * There is no restrictions for inter-NN or sink-to-app. */ -typedef enum _nns_tensor_type { +typedef enum _nns_tensor_type +{ _NNS_INT32 = 0, _NNS_UINT32, _NNS_INT16, @@ -58,22 +59,23 @@ typedef enum _nns_tensor_type { * @brief Byte-per-element of each tensor element type. */ static const unsigned int tensor_element_size[] = { - [_NNS_INT32] = 4, - [_NNS_UINT32] = 4, - [_NNS_INT16] = 2, - [_NNS_UINT16] = 2, - [_NNS_INT8] = 1, - [_NNS_UINT8] = 1, - [_NNS_FLOAT64] = 8, - [_NNS_FLOAT32] = 4, - [_NNS_INT64] = 8, - [_NNS_UINT64] = 8, + [_NNS_INT32] = 4, + [_NNS_UINT32] = 4, + [_NNS_INT16] = 2, + [_NNS_UINT16] = 2, + [_NNS_INT8] = 1, + [_NNS_UINT8] = 1, + [_NNS_FLOAT64] = 8, + [_NNS_FLOAT32] = 4, + [_NNS_INT64] = 8, + [_NNS_UINT64] = 8, }; /** * @brief NN Frameworks available for the tensor_filter element. */ -typedef enum _nnfw_type { +typedef enum _nnfw_type +{ _T_F_UNDEFINED = 0, /**< Not defined or supported. Cannot proceed in this status */ _T_F_CUSTOM, /**< Custom filter provided as a shared object (dysym) */ @@ -87,7 +89,8 @@ typedef enum _nnfw_type { struct _GstTensorFilterFramework; typedef struct _GstTensorFilterFramework GstTensorFilterFramework; -typedef enum { +typedef enum +{ _TFC_INIT = 0, _TFC_DIMENSION = 1, _TFC_TYPE = 2, @@ -102,6 +105,16 @@ typedef uint32_t tensor_dim[NNS_TENSOR_RANK_LIMIT]; typedef uint8_t *tensors[NNS_TENSOR_SIZE_LIMIT]; /**< Array of tensors */ /** + * @brief The unit of each data tensors. It will be used as an input/output tensor of other/tensors. + */ +typedef struct +{ + void *data; + size_t size; + tensor_type type; +} GstTensorMemory; + +/** * @brief Internal data structure for tensor info. */ typedef struct