Function arm_depthwise_conv_wrapper_s16_get_buffer_size

Function Documentation

int32_t arm_depthwise_conv_wrapper_s16_get_buffer_size(const cmsis_nn_dw_conv_params *dw_conv_params, const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims, const cmsis_nn_dims *output_dims)

Get size of additional buffer required by arm_depthwise_conv_wrapper_s16()

Where a byte count is computed, an out-of-range shape is reported as -1 rather than a wrapped size, and the sentinel is propagated before any ARM_NN_MAX() or sum over sub-sizer results, so it can never collapse into a plausible positive size. A caller that needs its dimensions validated must validate them rather than infer validity from a non-negative return.

Parameters:
  • dw_conv_params[in] Depthwise convolution parameters (e.g. strides, dilations, pads,…) Range of dw_conv_params->input_offset : Not used Range of dw_conv_params->input_offset : Not used

  • input_dims[in] Input (activation) tensor dimensions. Format: [H, W, C_IN] Batch argument N is not used and assumed to be 1.

  • filter_dims[in] Filter tensor dimensions. Format: [1, H, W, C_OUT]

  • output_dims[in] Output tensor dimensions. Format: [1, H, W, C_OUT]

Returns:

Size of additional memory required for optimizations in bytes, or -1 if the shape is out of range - a dimension the selected route reads is negative, or the required size would not fit in an int32_t. Only the fast depthwise route produces the -1, and it rejects a negative dimension on every build target, including the plain-C build where it needs no buffer - a route that needs no buffer may return -1, so always test for -1 before using the value. A shape that does not select the fast depthwise route returns 0 without range-checking the dimensions, so a 0 return is not a statement that the shape is valid.