blob: 5b63b70634218be684134fc4611aa420d76fafaf [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
2 * Copyright (c) 2017 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef __ARM_COMPUTE_NEDEPTHCONCATENATE_H__
25#define __ARM_COMPUTE_NEDEPTHCONCATENATE_H__
26
27#include "arm_compute/runtime/IFunction.h"
28
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000029#include "arm_compute/core/NEON/kernels/NEDepthConcatenateLayerKernel.h"
Georgios Pinitasac4e8732017-07-05 17:02:25 +010030#include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h"
31
Anthony Barbier6ff3b192017-09-04 18:44:23 +010032#include <memory>
33#include <vector>
34
35namespace arm_compute
36{
37class ITensor;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010038
39/** Basic function to execute concatenate tensors along z axis. This function calls the following kernels:
40 *
41 * -# @ref NEFillBorderKernel (executed if input's lowest two dimensions are smaller than respective output's dimensions)
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000042 * -# @ref NEDepthConcatenateLayerKernel
Anthony Barbier6ff3b192017-09-04 18:44:23 +010043 *
44 */
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000045class NEDepthConcatenateLayer : public IFunction
Anthony Barbier6ff3b192017-09-04 18:44:23 +010046{
47public:
48 /** Default constructor */
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000049 NEDepthConcatenateLayer();
Anthony Barbier6ff3b192017-09-04 18:44:23 +010050 /** Initialise the kernel's inputs vector and output.
51 *
Georgios Pinitasac4e8732017-07-05 17:02:25 +010052 * @param[in,out] inputs_vector The vectors containing all the tensors to concatenate. Data types supported: QS8/QS16/F16/F32.
53 * @param[out] output Output tensor. Data types supported: Same as @p inputs_vector.
Anthony Barbier6ff3b192017-09-04 18:44:23 +010054 */
55 void configure(std::vector<ITensor *> inputs_vector, ITensor *output);
56
57 // Inherited methods overridden:
58 void run() override;
59
60private:
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000061 std::vector<ITensor *> _inputs_vector;
62 std::unique_ptr<NEDepthConcatenateLayerKernel[]> _concat_kernels_vector;
63 std::unique_ptr<NEFillBorderKernel[]> _border_handlers_vector;
64 unsigned int _num_inputs;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010065};
66}
67#endif /* __ARM_COMPUTE_NEDEPTHCONCATENATE_H__ */