From b0203eba5d972a154a7cefc1b7cc7ea9b1a6ee20 Mon Sep 17 00:00:00 2001 From: Yongjoo Ahn Date: Wed, 21 Jun 2023 17:18:11 +0900 Subject: [PATCH] [common] Increase ML_TENSOR_SIZE_LIMIT 16 -> 256 - Increase `ML_TENSOR_SIZE_LIMIT` to 256 - Define `ML_TENSOR_SIZE_LIMIT_STATIC` and `ML_TENSOR_SIZE_EXTRA_LIMIT` to handle extra tensors Signed-off-by: Yongjoo Ahn --- c/include/ml-api-common.h | 5 +++-- c/include/nnstreamer.h | 4 ++-- c/src/ml-api-internal.h | 10 ++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/c/include/ml-api-common.h b/c/include/ml-api-common.h index 618adb7..cdd4740 100644 --- a/c/include/ml-api-common.h +++ b/c/include/ml-api-common.h @@ -104,8 +104,9 @@ typedef enum { /** * @brief The maximum number of other/tensor instances that other/tensors may have. * @since_tizen 5.5 + * @remarks The maximum size in Tizen APIs is 16 until tizen 7.0 and 256 since 8.0. */ -#define ML_TENSOR_SIZE_LIMIT (16) +#define ML_TENSOR_SIZE_LIMIT (256) /** * @brief The dimensions of a tensor that NNStreamer supports. @@ -337,7 +338,7 @@ int ml_tensors_info_get_tensor_dimension (ml_tensors_info_h info, unsigned int i /** * @brief Gets the size of tensors data in the given tensors information handle in bytes. - * @details If an application needs to get the total byte size of tensors, set the @a index '-1'. Note that the maximum number of tensors is 16 (#ML_TENSOR_SIZE_LIMIT). + * @details If an application needs to get the total byte size of tensors, set the @a index '-1'. Note that the maximum number of tensors is #ML_TENSOR_SIZE_LIMIT. * @since_tizen 5.5 * @param[in] info The handle of tensors information. * @param[in] index The index of the tensor. diff --git a/c/include/nnstreamer.h b/c/include/nnstreamer.h index c8e6cf8..fa379e6 100644 --- a/c/include/nnstreamer.h +++ b/c/include/nnstreamer.h @@ -129,7 +129,7 @@ typedef enum { * @since_tizen 5.5 * @remarks The @a data can be used only in the callback. To use outside, make a copy. * @remarks The @a info can be used only in the callback. To use outside, make a copy. - * @param[in] data The handle of the tensor output of the pipeline (a single frame. tensor/tensors). Number of tensors is determined by ml_tensors_info_get_count() with the handle 'info'. Note that the maximum number of tensors is 16 (#ML_TENSOR_SIZE_LIMIT). + * @param[in] data The handle of the tensor output of the pipeline (a single frame. tensor/tensors). Number of tensors is determined by ml_tensors_info_get_count() with the handle 'info'. Note that the maximum number of tensors is #ML_TENSOR_SIZE_LIMIT. * @param[in] info The handle of tensors information (cardinality, dimension, and type of given tensor/tensors). * @param[in,out] user_data User application's private data. */ @@ -150,7 +150,7 @@ typedef void (*ml_pipeline_state_cb) (ml_pipeline_state_e state, void *user_data * @remarks The @a data can be used only in the callback. To use outside, make a copy. * @remarks The @a info can be used only in the callback. To use outside, make a copy. * @remarks The @a result can be used only in the callback and should not be released. - * @param[in] data The handle of the tensor output of the pipeline (a single frame. tensor/tensors). Number of tensors is determined by ml_tensors_info_get_count() with the handle 'info'. Note that the maximum number of tensors is 16 (#ML_TENSOR_SIZE_LIMIT). + * @param[in] data The handle of the tensor output of the pipeline (a single frame. tensor/tensors). Number of tensors is determined by ml_tensors_info_get_count() with the handle 'info'. Note that the maximum number of tensors is #ML_TENSOR_SIZE_LIMIT. * @param[in] info The handle of tensors information (cardinality, dimension, and type of given tensor/tensors). * @param[out] result Result of the user-defined condition. 0 refers to FALSE and a non-zero value refers to TRUE. The application should set the result value for given data. * @param[in,out] user_data User application's private data. diff --git a/c/src/ml-api-internal.h b/c/src/ml-api-internal.h index 31ee897..327486c 100644 --- a/c/src/ml-api-internal.h +++ b/c/src/ml-api-internal.h @@ -135,6 +135,16 @@ typedef enum { #define ML_TENSOR_RANK_LIMIT_PREV (4) /** + * @brief The tensor size limit with static gst buffer. + */ +#define ML_TENSOR_SIZE_LIMIT_STATIC (16) + +/** + * @brief The size limit of "extra" tensors. + */ +#define ML_TENSOR_SIZE_EXTRA_LIMIT (ML_TENSOR_SIZE_LIMIT - ML_TENSOR_SIZE_LIMIT_STATIC) + +/** * @brief Data structure for tensor information. * @since_tizen 5.5 */ -- 2.7.4