Function arm_svdf_s8_input_ctx_get_buffer_size¶
Defined in File arm_nnfunctions.h
Function Documentation¶
-
int32_t arm_svdf_s8_input_ctx_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *weights_feature_dims)¶
Get size of the input_ctx staging buffer required by arm_svdf_s8().
Returns input_dims->n * weights_feature_dims->n * sizeof(int32_t). Unlike arm_svdf_s8_get_buffer_size(), this figure does not vary by build target: arm_svdf_s8() stages this buffer on every build, not only under MVE, so there is no _dsp / _mve pair to choose between and the validation runs on every target.
Note
This is a different buffer from the one arm_svdf_s8_get_buffer_size() describes. That one sizes the read-only kernel sums passed as ctx; this one sizes the scratch passed as input_ctx.
Note
0 is a valid return for a degenerate shape (input_dims->n == 0). Unlike the general rule in README.md, a 0 here does NOT mean you may pass { NULL, 0 }: arm_svdf_s8() rejects a NULL input_ctx->buf with ARM_CMSIS_NN_ARG_ERROR regardless of the size. -1 is used only for an out-of-range or NULL argument.
- Parameters:
input_dims – [in] Input tensor dimensions, i.e. the same cmsis_nn_dims passed to arm_svdf_s8()
weights_feature_dims – [in] Weights (feature) tensor dimensions, i.e. the same cmsis_nn_dims passed to arm_svdf_s8()
- Returns:
The function returns required buffer size in bytes, or -1 if either pointer is NULL, if input_dims->n or weights_feature_dims->n is negative, or if the required size would not fit in an int32_t