arm_avgpool_get_buffer_sizes_s16.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /* ----------------------------------------------------------------------
  19. * Project: CMSIS NN Library
  20. * Title: arm_avgpool_get_buffer_sizes_s16.c
  21. * Description: Collection of get buffer size functions for avgpool s16 layer function.
  22. *
  23. * $Date: 13 January 2023
  24. * $Revision: V.1.0.0
  25. *
  26. * Target : Arm(R) M-Profile Architecture
  27. *
  28. * -------------------------------------------------------------------- */
  29. #include "arm_nnfunctions.h"
  30. /**
  31. * @ingroup Pooling
  32. */
  33. /**
  34. * @addtogroup GetBufferSizePooling
  35. * @{
  36. */
  37. int32_t arm_avgpool_s16_get_buffer_size(const int output_x, const int ch_src)
  38. {
  39. #if defined(ARM_MATH_MVEI)
  40. return arm_avgpool_s16_get_buffer_size_mve(output_x, ch_src);
  41. #elif defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI)
  42. return arm_avgpool_s16_get_buffer_size_dsp(output_x, ch_src);
  43. #else
  44. (void)output_x;
  45. (void)ch_src;
  46. return 0;
  47. #endif
  48. }
  49. int32_t arm_avgpool_s16_get_buffer_size_dsp(const int output_x, const int ch_src)
  50. {
  51. (void)output_x;
  52. return (ch_src * sizeof(int32_t));
  53. }
  54. int32_t arm_avgpool_s16_get_buffer_size_mve(const int output_x, const int ch_src)
  55. {
  56. (void)output_x;
  57. (void)ch_src;
  58. return 0;
  59. }
  60. /**
  61. * @} end of GetBufferSizePooling group
  62. */