1 /*
2  * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved.
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_concatenation_s8_z.c
22  * Description:  s8 version of concatenation along the Z axis
23  *
24  * $Date:        October 2019
25  * $Revision:    V.1.0.0
26  *
27  * Target Processor:  Cortex-M cores
28  *
29  * -------------------------------------------------------------------- */
30 
31 #include "arm_nnfunctions.h"
32 
33 /**
34  *  @ingroup groupNN
35  */
36 
37 /**
38  * @addtogroup Concatenation
39  * @{
40  */
41 
42 /*
43  *  s8 version of concatenation along the Z axis
44  *
45  * Refer to header file for details.
46  *
47  */
arm_concatenation_s8_z(const int8_t * input,const uint16_t input_x,const uint16_t input_y,const uint16_t input_z,const uint16_t input_w,int8_t * output,const uint16_t output_z,const uint32_t offset_z)48 void arm_concatenation_s8_z(const int8_t *input,
49                             const uint16_t input_x,
50                             const uint16_t input_y,
51                             const uint16_t input_z,
52                             const uint16_t input_w,
53                             int8_t *output,
54                             const uint16_t output_z,
55                             const uint32_t offset_z)
56 {
57     const uint32_t input_copy_size = input_x * input_y * input_z;
58     const uint32_t output_stride = input_x * input_y * output_z;
59 
60     output += offset_z * (input_x * input_y);
61 
62     uint32_t i;
63 
64     for (i = 0; i < input_w; ++i)
65     {
66         memcpy(output, input, input_copy_size);
67         input += input_copy_size;
68         output += output_stride;
69     }
70 }
71 
72 /**
73  * @} end of Concatenation group
74  */
75