X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=documentation%2F_n_e_convolution_kernel_8h_source.xhtml;h=3b8874197aaba4a856eea66c2eb297fb2e6e3584;hb=06ea048f062a50404b1b3998a61a45449c2d1f0f;hp=be6a3dd06e8daca7edfca8086f1ec62f5fe7b7e7;hpb=871448ee8eff790c4ccc3250008dd71170cc78b2;p=platform%2Fupstream%2Farmcl.git diff --git a/documentation/_n_e_convolution_kernel_8h_source.xhtml b/documentation/_n_e_convolution_kernel_8h_source.xhtml index be6a3dd..3b88741 100644 --- a/documentation/_n_e_convolution_kernel_8h_source.xhtml +++ b/documentation/_n_e_convolution_kernel_8h_source.xhtml @@ -6,7 +6,7 @@ -ARM Compute Library: arm_compute/core/NEON/kernels/NEConvolutionKernel.h Source File +Compute Library: arm_compute/core/NEON/kernels/NEConvolutionKernel.h Source File @@ -39,8 +39,8 @@ -
ARM Compute Library -  17.03.1 +
Compute Library +  18.02
@@ -55,6 +55,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
-Go to the documentation of this file.
1 /*
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_NECONVOLUTIONKERNEL_H__
25 #define __ARM_COMPUTE_NECONVOLUTIONKERNEL_H__
26 
29 
30 #include <array>
31 #include <cstdint>
32 #include <vector>
33 
34 namespace arm_compute
35 {
36 class ITensor;
37 
38 /****************************************************************************************\
39  * Square Convolution *
40 \****************************************************************************************/
41 
54 template <unsigned int matrix_size>
56 {
57 public:
68  void configure(const ITensor *input, ITensor *output, const int16_t *conv, uint32_t scale, bool border_undefined);
69 
70  // Inherited methods overridden:
71  void run(const Window &window) override;
72  BorderSize border_size() const override;
73 
74 private:
75  template <typename OutputType>
76  void convolution(const Window &win);
77 
78 protected:
79  uint32_t _scale;
80  std::array<int16_t, matrix_size *matrix_size> _convolution;
81 };
82 
91 
92 /****************************************************************************************\
93  * Separable Square Convolution *
94 \****************************************************************************************/
95 
97 template <unsigned int matrix_size>
99 {
100 public:
103 
111  void configure(const ITensor *input, ITensor *output, const int16_t *conv_row, bool border_undefined);
112 
113  // Inherited methods overridden:
114  void run(const Window &window) override;
115  BorderSize border_size() const override;
116 
117 private:
122  template <typename OutputType>
123  void convolve(const Window &window);
124 
125  std::array<int16_t, matrix_size> _conv_row;
126  BorderSize _border_size;
127 };
128 
135 
137 template <unsigned int matrix_size>
139 {
140 public:
143 
152  void configure(const ITensor *input, ITensor *output, const int16_t *conv_col, uint32_t scale, bool border_undefined);
153 
154  // Inherited methods overridden:
155  void run(const Window &window) override;
156  BorderSize border_size() const override;
157 
158 private:
164  template <typename OutputType>
165  void convolution_u16(const Window &win);
171  template <typename OutputType>
172  void convolution_s16(const Window &win);
178  template <typename OutputType>
179  void convolution_s32(const Window &win);
180 
181  std::array<int16_t, matrix_size> _conv_col;
182  uint32_t _scale;
183 };
184 
191 
192 /****************************************************************************************\
193  * Rectangle Convolution *
194 \****************************************************************************************/
195 
201 {
202 public:
223  void configure(const ITensor *input, ITensor *output, const int16_t *conv, uint32_t width, uint32_t height, uint32_t scale, bool border_undefined);
224 
225  // Inherited methods overridden:
226  void run(const Window &window) override;
227  BorderSize border_size() const override;
228 
229 private:
230  unsigned int get_index(uint32_t val);
235  template <typename OutputType, unsigned int rows, unsigned int cols>
236  void convolution(const Window &win);
237 
238 protected:
239  const ITensor *_input;
240  ITensor *_output;
241  uint32_t _scale;
242  std::vector<int16_t> _convolution;
243  BorderSize _border_size;
244  uint32_t _func_idx;
245  const static unsigned int _nr_supported_sizes
246  {
247  4
248  };
249 };
250 }
251 #endif /*__ARM_COMPUTE_NECONVOLUTIONKERNEL_H__ */
Kernel for the Vertical pass of a Separable Convolution.
+Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2018 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_NECONVOLUTIONKERNEL_H__
25 #define __ARM_COMPUTE_NECONVOLUTIONKERNEL_H__
26 
29 
30 #include <array>
31 #include <cstdint>
32 #include <vector>
33 
34 namespace arm_compute
35 {
36 class ITensor;
37 
38 /****************************************************************************************\
39  * Square Convolution *
40 \****************************************************************************************/
41 
54 template <unsigned int matrix_size>
56 {
57 public:
58  const char *name() const override
59  {
60  return "NEConvolutionKernel";
61  }
72  void configure(const ITensor *input, ITensor *output, const int16_t *conv, uint32_t scale, bool border_undefined);
73 
74  // Inherited methods overridden:
75  void run(const Window &window, const ThreadInfo &info) override;
76  BorderSize border_size() const override;
77 
78 private:
79  template <typename OutputType>
80  void convolution(const Window &win);
81 
82 protected:
83  uint32_t _scale;
84  std::array<int16_t, matrix_size *matrix_size> _convolution;
85 };
86 
95 
96 /****************************************************************************************\
97  * Separable Square Convolution *
98 \****************************************************************************************/
99 
101 template <unsigned int matrix_size>
103 {
104 public:
105  const char *name() const override
106  {
107  return "NESeparableConvolutionHorKernel";
108  }
111 
119  void configure(const ITensor *input, ITensor *output, const int16_t *conv_row, bool border_undefined);
120 
121  // Inherited methods overridden:
122  void run(const Window &window, const ThreadInfo &info) override;
123  BorderSize border_size() const override;
124 
125 private:
130  template <typename OutputType>
131  void convolve(const Window &window);
132 
133  std::array<int16_t, matrix_size> _conv_row;
134  BorderSize _border_size;
135 };
136 
143 
145 template <unsigned int matrix_size>
147 {
148 public:
149  const char *name() const override
150  {
151  return "NESeparableConvolutionVertKernel";
152  }
155 
164  void configure(const ITensor *input, ITensor *output, const int16_t *conv_col, uint32_t scale, bool border_undefined);
165 
166  // Inherited methods overridden:
167  void run(const Window &window, const ThreadInfo &info) override;
168  BorderSize border_size() const override;
169 
170 private:
176  template <typename OutputType>
177  void convolution_u16(const Window &win);
183  template <typename OutputType>
184  void convolution_s16(const Window &win);
190  template <typename OutputType>
191  void convolution_s32(const Window &win);
192 
193  std::array<int16_t, matrix_size> _conv_col;
194  uint32_t _scale;
195 };
196 
203 
204 /****************************************************************************************\
205  * Rectangle Convolution *
206 \****************************************************************************************/
207 
213 {
214 public:
215  const char *name() const override
216  {
217  return "NEConvolutionRectangleKernel";
218  }
239  void configure(const ITensor *input, ITensor *output, const int16_t *conv, uint32_t width, uint32_t height, uint32_t scale, bool border_undefined);
240 
241  // Inherited methods overridden:
242  void run(const Window &window, const ThreadInfo &info) override;
243  BorderSize border_size() const override;
244 
245 private:
246  unsigned int get_index(uint32_t val);
251  template <typename OutputType, unsigned int rows, unsigned int cols>
252  void convolution(const Window &win);
253 
254 protected:
255  const ITensor *_input;
256  ITensor *_output;
257  uint32_t _scale;
258  std::vector<int16_t> _convolution;
259  BorderSize _border_size;
260  uint32_t _func_idx;
261  const static unsigned int _nr_supported_sizes
262  {
263  4
264  };
265 };
266 } // namespace arm_compute
267 #endif /*__ARM_COMPUTE_NECONVOLUTIONKERNEL_H__ */
Kernel for the Vertical pass of a Separable Convolution.
Interface for the kernel to run an arbitrary size convolution on a tensor.
+
const char * name() const override
Name of the kernel.
void configure(const ITensor *input, ITensor *output, const int16_t *conv, uint32_t scale, bool border_undefined)
Initialise the kernel&#39;s input, output and border mode.
-
Container for 2D border size.
Definition: Types.h:116
-
Common interface for all kernels implemented in C++.
Definition: ICPPKernel.h:34
-
Kernel for the Horizontal pass of a Separable Convolution.
+
Container for 2D border size.
Definition: Types.h:229
+
Common interface for all kernels implemented in C++.
Definition: ICPPKernel.h:35
+
const char * name() const override
Name of the kernel.
+ +
Kernel for the Horizontal pass of a Separable Convolution.
Interface for simple NEON kernels having 1 tensor input and 1 tensor output.
Interface for NEON tensor.
Definition: ITensor.h:36
- -
void run(const Window &window) override
Execute the kernel on the passed window.
-
Kernel for the running convolution on a rectangle matrix.
+
src info() -> set_format(Format::S16)
+
This file contains all available output stages for GEMMLowp on OpenCL.
Definition: 01_library.dox:1
+
const char * name() const override
Name of the kernel.
+
Kernel for the running convolution on a rectangle matrix.
+
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
BorderSize border_size() const override
The size of the border for that kernel.
+
const char * name() const override
Name of the kernel.
NEConvolutionKernel()
Default constructor.
+ +
ICPPSimpleKernel & operator=(const ICPPSimpleKernel &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
const Window & window() const
The maximum window the kernel can be executed on.
@@ -140,7 +149,7 @@ $(document).ready(function(){initNavTree('_n_e_convolution_kernel_8h_source.xhtm