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 /* ----------------------------------------------------------------------
20  * Project:      CMSIS NN Library
21  * Title:        arm_avgpool_get_buffer_sizes_s8.c
22  * Description:  Collection of get buffer size functions for avgpool s8 layer function.
23  *
24  * $Date:        25 January 2023
25  * $Revision:    V.1.0.0
26  *
27  * Target :  Arm(R) M-Profile Architecture
28  *
29  * -------------------------------------------------------------------- */
30 
31 #include "arm_nnfunctions.h"
32 
33 /**
34  *  @ingroup Pooling
35  */
36 
37 /**
38  * @addtogroup GetBufferSizePooling
39  * @{
40  */
41 
arm_avgpool_s8_get_buffer_size(const int output_x,const int ch_src)42 int32_t arm_avgpool_s8_get_buffer_size(const int output_x, const int ch_src)
43 {
44 #if defined(ARM_MATH_MVEI)
45     return arm_avgpool_s8_get_buffer_size_mve(output_x, ch_src);
46 #elif defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI)
47     return arm_avgpool_s8_get_buffer_size_dsp(output_x, ch_src);
48 #else
49     (void)output_x;
50     (void)ch_src;
51     return 0;
52 #endif
53 }
54 
arm_avgpool_s8_get_buffer_size_dsp(const int output_x,const int ch_src)55 int32_t arm_avgpool_s8_get_buffer_size_dsp(const int output_x, const int ch_src)
56 {
57     (void)output_x;
58     return (ch_src * sizeof(int32_t));
59 }
60 
arm_avgpool_s8_get_buffer_size_mve(const int output_x,const int ch_src)61 int32_t arm_avgpool_s8_get_buffer_size_mve(const int output_x, const int ch_src)
62 {
63     (void)output_x;
64     (void)ch_src;
65 
66     return 0;
67 }
68 
69 /**
70  * @} end of GetBufferSizePooling group
71  */
72