1 /*
2  * SPDX-FileCopyrightText: Copyright 2022 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 #pragma once
20 #include <stdint.h>
21 
get_bias_address(const int32_t * bias,int32_t size)22 static inline const int32_t *get_bias_address(const int32_t *bias, int32_t size)
23 {
24     const int32_t *return_bias = NULL;
25     for (int i = 0; i < size; i++)
26     {
27         if (bias[i] != 0)
28         {
29             return_bias = bias;
30             break;
31         }
32     }
33     return return_bias;
34 }
35 
get_bias_s64_address(const int64_t * bias,int32_t size)36 static inline const int64_t *get_bias_s64_address(const int64_t *bias, int32_t size)
37 {
38     const int64_t *return_bias = NULL;
39     for (int i = 0; i < size; i++)
40     {
41         if (bias[i] != 0)
42         {
43             return_bias = bias;
44             break;
45         }
46     }
47     return return_bias;
48 }
49