From acb461efd25399f142d8e4ee0c352355d73cea01 Mon Sep 17 00:00:00 2001 From: Yelin Jeong Date: Fri, 12 Jan 2024 13:47:36 +0900 Subject: [PATCH] [common] Move enum tensor_layout This patch moves tensor_layout enum to tensor_typedef. tensor_layout can be used in other elements. Signed-off-by: Yelin Jeong --- .../include/nnstreamer_plugin_api_filter.h | 27 ------------------- gst/nnstreamer/include/tensor_typedef.h | 26 ++++++++++++++++++ 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/gst/nnstreamer/include/nnstreamer_plugin_api_filter.h b/gst/nnstreamer/include/nnstreamer_plugin_api_filter.h index a33fa6f40d..b678ea522e 100644 --- a/gst/nnstreamer/include/nnstreamer_plugin_api_filter.h +++ b/gst/nnstreamer/include/nnstreamer_plugin_api_filter.h @@ -101,33 +101,6 @@ typedef enum ACCL_NPU_SR = 0x4100, /**< specify device as any SR npu, if possible */ } accl_hw; -/** - * @brief Internal tensor layout format for other/tensor - * - * The layout is needed by some of the subplugins to appropriately process the - * data based on the axis of the channel in the data. Layout information will be - * currently utilized by only some of the sublpugins (SNAP, NNFW), and should be - * provided to use some of the subplugins (SNAP). - * - * Tensor layout is stored locally in the tensor filter element, and not shared - * with other elements in the pipeline. Thus, tensor layout is not part of the - * capabilities of the element, and does not take part in the caps negotiation. - * - * NONE layout implies that the layout of the data is neither NHWC nor NCHW. ' - * However, ANY layout implies that the layout of the provided data is not - * relevant. - * - * @note Providing tensor layout can also decide acceleration to be supported - * as not all the accelerators might support all the layouts (NYI). - */ -typedef enum _nns_tensor_layout -{ - _NNS_LAYOUT_ANY = 0, /**< does not care about the data layout */ - _NNS_LAYOUT_NHWC, /**< NHWC: channel last layout */ - _NNS_LAYOUT_NCHW, /**< NCHW: channel first layout */ - _NNS_LAYOUT_NONE, /**< NONE: none of the above defined layouts */ -} tensor_layout; - typedef tensor_layout tensors_layout[NNS_TENSOR_SIZE_LIMIT]; /** diff --git a/gst/nnstreamer/include/tensor_typedef.h b/gst/nnstreamer/include/tensor_typedef.h index 0a4e92e559..bd75c85ca0 100644 --- a/gst/nnstreamer/include/tensor_typedef.h +++ b/gst/nnstreamer/include/tensor_typedef.h @@ -199,6 +199,32 @@ typedef enum _tensor_format _NNS_TENSOR_FORMAT_END } tensor_format; +/** + * @brief Tensor layout format for other/tensor + * + * The layout is needed by some of the element to appropriately process the + * data based on the axis of the channel in the data. Layout information will be + * currently utilized by only some of the elements (SNAP, NNFW in tensor_filter, + * PADDING mode in tensor_transform) + * + * Tensor layout is not part of the capabilities of the element, + * and does not take part in the caps negotiation. + * + * NONE layout implies that the layout of the data is neither NHWC nor NCHW. ' + * However, ANY layout implies that the layout of the provided data is not + * relevant. + * + * @note Providing tensor layout can also decide acceleration to be supported + * as not all the accelerators might support all the layouts (NYI). + */ +typedef enum _nns_tensor_layout +{ + _NNS_LAYOUT_ANY = 0, /**< does not care about the data layout */ + _NNS_LAYOUT_NHWC, /**< NHWC: channel last layout */ + _NNS_LAYOUT_NCHW, /**< NCHW: channel first layout */ + _NNS_LAYOUT_NONE, /**< NONE: none of the above defined layouts */ +} tensor_layout; + /** * @brief To make the code simple with all the types. "C++ Template"-like. */