Function arm_avgpool_s8_get_buffer_size

Function Documentation

int32_t arm_avgpool_s8_get_buffer_size(const int dim_dst_width, const int ch_src)

Get the required buffer size for S8 average pooling function.

Unlike the fully connected and SVDF families, it is the DSP leg that carries a byte count here: for a valid (non-negative, in-range) ch_src this returns ch_src * sizeof(int32_t) on builds with the DSP extension but no MVE, and 0 on builds with MVE and on plain-C builds. For an invalid ch_src it returns -1 on every build target. arm_avgpool_s8() depends on that sentinel being non-zero, since it reads a non-zero size as “ctx->buf is required” before touching the accumulator buffer.

Parameters:
  • dim_dst_width[in] output tensor dimension

  • ch_src[in] number of input tensor channels

Returns:

The function returns required buffer size in bytes, or -1 if ch_src is negative or the required size would not fit in an int32_t