Function arm_svdf_f16_output_ctx_get_buffer_size

Function Documentation

int32_t arm_svdf_f16_output_ctx_get_buffer_size(const cmsis_nn_svdf_params_f16 *svdf_params, const cmsis_nn_dims *input_dims, const cmsis_nn_dims *weights_feature_dims)

Get size of the output_ctx staging buffer required by arm_svdf_f16().

Note

arm_svdf_f16() stages float16_t, so this is HALF the byte count arm_svdf_f32_output_ctx_get_buffer_size() returns for the same shape.

Note

Same -1 and degenerate-0 contract as arm_svdf_f16_input_ctx_get_buffer_size(), including that a 0 does not license passing { NULL, 0 }. A rank greater than weights_feature_dims->n truncates the unit count to 0 and so returns 0.

Parameters:
  • svdf_params[in] SVDF operator parameters; only svdf_params->rank is read.

  • input_dims[in] Input tensor dimensions, i.e. the same cmsis_nn_dims passed to arm_svdf_f16().

  • weights_feature_dims[in] Feature-weight tensor dimensions, i.e. the same cmsis_nn_dims passed to arm_svdf_f16().

Returns:

Required buffer size in bytes: input_dims->n * (weights_feature_dims->n / svdf_params->rank) * sizeof(float16_t), truncating division to match the kernel’s own unit count. Returns -1 if any pointer is NULL, if svdf_params->rank is zero or negative, if input_dims->n or weights_feature_dims->n is negative, or if the product would not fit in an int32_t.