blob: 15bde4fde79dfba6830e18952428a09f9a8dc114 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
2 * Copyright (c) 2016, 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_CLCHANNELCOMBINEKERNEL_H__
25#define __ARM_COMPUTE_CLCHANNELCOMBINEKERNEL_H__
26
27#include "arm_compute/core/CL/ICLKernel.h"
28
29#include <array>
30#include <cstdint>
31
32namespace arm_compute
33{
34class ICLMultiImage;
35class ICLTensor;
36using ICLImage = ICLTensor;
37
38/** Interface for the channel combine kernel */
39class CLChannelCombineKernel : public ICLKernel
40{
41public:
42 /** Default constructor */
43 CLChannelCombineKernel();
44 /** Prevent instances of this class from being copied (As this class contains pointers) */
45 CLChannelCombineKernel(const CLChannelCombineKernel &) = delete;
46 /** Prevent instances of this class from being copied (As this class contains pointers) */
47 CLChannelCombineKernel &operator=(const CLChannelCombineKernel &) = delete;
48 /** Allow instances of this class to be moved */
49 CLChannelCombineKernel(CLChannelCombineKernel &&) = default;
50 /** Allow instances of this class to be moved */
51 CLChannelCombineKernel &operator=(CLChannelCombineKernel &&) = default;
52 /** Default destructor */
53 ~CLChannelCombineKernel() = default;
54 /** Configure function's inputs and outputs.
55 *
56 * @param[in] plane0 The 2D plane that forms channel 0. Must be of U8 format.
57 * @param[in] plane1 The 2D plane that forms channel 1. Must be of U8 format.
58 * @param[in] plane2 The 2D plane that forms channel 2. Must be of U8 format.
59 * @param[in] plane3 The 2D plane that forms channel 3. Must be of U8 format.
60 * @param[out] output The single planar output tensor.
61 */
62 void configure(const ICLTensor *plane0, const ICLTensor *plane1, const ICLTensor *plane2, const ICLTensor *plane3, ICLTensor *output);
63 /** Configure function's inputs and outputs.
64 *
65 * @param[in] plane0 The 2D plane that forms channel 0. Must be of U8 format.
66 * @param[in] plane1 The 2D plane that forms channel 1. Must be of U8 format.
67 * @param[in] plane2 The 2D plane that forms channel 2. Must be of U8 format.
68 * @param[out] output The multi planar output tensor.
69 */
70 void configure(const ICLImage *plane0, const ICLImage *plane1, const ICLImage *plane2, ICLMultiImage *output);
71
72 // Inherited methods overridden:
73 void run(const Window &window, cl::CommandQueue &queue) override;
74
75private:
76 std::array<const ICLTensor *, 4> _planes;
77 ICLTensor *_output;
78 ICLMultiImage *_output_multi;
79 std::array<uint32_t, 3> _x_subsampling;
80 std::array<uint32_t, 3> _y_subsampling;
81};
Gian Marco Iodicef670a0a2017-09-18 12:20:45 +010082} // namespace arm_compute
Anthony Barbier6ff3b192017-09-04 18:44:23 +010083#endif /* __ARM_COMPUTE_CLCHANNELCOMBINEKERNEL_H__ */