blob: 1b946263566fdeec5083eb8b3e9e854b92f7998d [file] [log] [blame]
Anthony Barbier7068f992017-10-26 15:23:08 +01001/*
Stephen Lie855c232018-01-04 14:13:22 +08002 * Copyright (c) 2017-2018 ARM Limited.
Anthony Barbier7068f992017-10-26 15:23:08 +01003 *
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#include "arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h"
25
26#include "arm_compute/core/AccessWindowStatic.h"
27#include "arm_compute/core/Error.h"
28#include "arm_compute/core/GLES_COMPUTE/GCHelpers.h"
29#include "arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h"
30#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h"
31#include "arm_compute/core/Helpers.h"
32#include "arm_compute/core/IAccessWindow.h"
33#include "arm_compute/core/ITensor.h"
34#include "arm_compute/core/Types.h"
35#include "arm_compute/core/Validate.h"
36#include "support/ToolchainSupport.h"
37
38using namespace arm_compute;
39
40template <unsigned int kernel_size>
41GCDirectConvolutionLayerKernel<kernel_size>::GCDirectConvolutionLayerKernel()
42 : _input(nullptr), _bias(nullptr), _weights(nullptr), _output(nullptr), _border_size(0), _conv_stride_x(0), _conv_stride_y(0), _conv_pad_x(0), _conv_pad_y(0), _lws(gles::NDRange(1U, 1U, 1U))
43{
44}
45
46template <unsigned int kernel_size>
47BorderSize GCDirectConvolutionLayerKernel<kernel_size>::border_size() const
48{
49 return _border_size;
50}
51
52template <unsigned int kernel_size>
53void GCDirectConvolutionLayerKernel<kernel_size>::configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *bias, IGCTensor *output, const PadStrideInfo &conv_info)
54{
55 ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32);
Anthony Barbier7068f992017-10-26 15:23:08 +010056 ARM_COMPUTE_ERROR_ON(weights->info()->dimension(2) != input->info()->dimension(2));
57 ARM_COMPUTE_ERROR_ON(weights->info()->dimension(0) != weights->info()->dimension(1));
58 ARM_COMPUTE_ERROR_ON(weights->info()->num_dimensions() > 4);
59 ARM_COMPUTE_ERROR_ON_MSG((kernel_size == 3 && std::get<0>(conv_info.stride()) > 2), "Strides larger than 2 not supported in 3x3 direct convolution!");
60 ARM_COMPUTE_ERROR_ON(kernel_size != weights->info()->dimension(0));
61
62 if(bias != nullptr)
63 {
64 ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(weights, bias);
65 // FIXME: Bug in framework, workaround it in tests currently.
66 //ARM_COMPUTE_ERROR_ON(bias->info()->dimension(0) != weights->info()->dimension(3));
67 ARM_COMPUTE_ERROR_ON(bias->info()->num_dimensions() > 1);
68 }
69
Frank Leib9d38ee2017-12-05 10:43:33 +080070 // Get convolved dimensions
71 unsigned int owidth = 0;
72 unsigned int oheight = 0;
73 std::tie(owidth, oheight) = scaled_dimensions(input->info()->dimension(0), input->info()->dimension(1), kernel_size, kernel_size, conv_info);
74
75 TensorShape output_shape = input->info()->tensor_shape();
76 output_shape.set(0, owidth);
77 output_shape.set(1, oheight);
78 output_shape.set(2, weights->info()->dimension(3));
79
80 // Output auto inizialitation if not yet initialized
81 auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type(), input->info()->fixed_point_position());
82
83 ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights, output);
84 ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(output->info()->tensor_shape(), output_shape);
85 ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
86 ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(input, output);
Anthony Barbier21f67d62018-02-16 15:17:48 +000087 ARM_COMPUTE_ERROR_ON(!conv_info.padding_is_symmetric());
Frank Leib9d38ee2017-12-05 10:43:33 +080088
Anthony Barbier7068f992017-10-26 15:23:08 +010089 _conv_stride_x = std::get<0>(conv_info.stride());
90 _conv_stride_y = std::get<1>(conv_info.stride());
91 _conv_pad_x = std::get<0>(conv_info.pad());
92 _conv_pad_y = std::get<1>(conv_info.pad());
93
94 _input = input;
95 _weights = weights;
96 _output = output;
97 _bias = bias;
98 _border_size = BorderSize(_conv_pad_y, _conv_pad_x);
99
100 std::set<std::string> options;
101
102 options.emplace("#define LOCAL_SIZE_X " + support::cpp11::to_string(_lws[0]));
103 options.emplace("#define LOCAL_SIZE_Y " + support::cpp11::to_string(_lws[1]));
104 options.emplace("#define LOCAL_SIZE_Z " + support::cpp11::to_string(_lws[2]));
105 options.emplace("#define STRIDE_X " + support::cpp11::to_string(_conv_stride_x));
Xinghang Zhou4af62a02017-11-02 16:37:24 +0800106 options.emplace("#define STRIDE_Y " + support::cpp11::to_string(_conv_stride_y));
Anthony Barbier7068f992017-10-26 15:23:08 +0100107
108 std::string dt_name = (input->info()->data_type() == DataType::F32) ? "DATA_TYPE_FP32" : "DATA_TYPE_FP16";
109 options.emplace(("#define " + dt_name));
110
111 unsigned int num_elems_read_per_iteration_x = kernel_size * _conv_stride_x;
112 unsigned int num_elems_read_per_iteration_y = 1;
113 unsigned int num_elems_written_per_iteration_x = 1;
114 unsigned int num_elems_written_per_iteration_y = 1;
115 unsigned int num_elems_written_per_iteration_z = 1;
116
117 if(kernel_size == 3)
118 {
119 if((_conv_stride_x == 1) && (_conv_stride_y == 1))
120 {
121 switch(input->info()->data_type())
122 {
Anthony Barbier7068f992017-10-26 15:23:08 +0100123 case DataType::F16:
Joel Liang63875432018-01-02 14:05:06 +0800124 // TODO(APPBROWSER-299): Choose the most optimal path and remove others.
125#define PROCESS_4X_3Y_1Z
126
127#if defined(PROCESS_8X_3Y_1Z)
128 options.emplace("#define PROCESS_8X_3Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100129 num_elems_read_per_iteration_x = 16;
130 num_elems_read_per_iteration_y = 5;
131 num_elems_written_per_iteration_x = 8;
132 num_elems_written_per_iteration_y = 3;
Joel Liang63875432018-01-02 14:05:06 +0800133#elif defined(PROCESS_4X_3Y_1Z)
134 options.emplace("#define PROCESS_4X_3Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100135 num_elems_read_per_iteration_x = 8;
136 num_elems_read_per_iteration_y = 5;
137 num_elems_written_per_iteration_x = 4;
138 num_elems_written_per_iteration_y = 3;
Joel Liang63875432018-01-02 14:05:06 +0800139#elif defined(PROCESS_4X_4Y_1Z)
140 options.emplace("#define PROCESS_4X_4Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100141 num_elems_read_per_iteration_x = 8;
142 num_elems_read_per_iteration_y = 6;
143 num_elems_written_per_iteration_x = 4;
144 num_elems_written_per_iteration_y = 4;
Joel Liang63875432018-01-02 14:05:06 +0800145#elif defined(PROCESS_4X_3Y_2Z)
146 options.emplace("#define PROCESS_4X_3Y_2Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100147 num_elems_read_per_iteration_x = 8;
148 num_elems_read_per_iteration_y = 5;
149 num_elems_written_per_iteration_x = 4;
150 num_elems_written_per_iteration_y = 3;
151 num_elems_written_per_iteration_z = 2;
Joel Liang63875432018-01-02 14:05:06 +0800152#endif /* PROCESS_nX_nY_nZ */
153#undef PROCESS_8X_3Y_1Z
154#undef PROCESS_4X_3Y_1Z
155#undef PROCESS_4X_4Y_1Z
156#undef PROCESS_4X_3Y_2Z
Anthony Barbier7068f992017-10-26 15:23:08 +0100157 break;
158
159 case DataType::F32:
Joel Liang63875432018-01-02 14:05:06 +0800160 options.emplace("#define PROCESS_4X_3Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100161 num_elems_read_per_iteration_x = 8;
162 num_elems_read_per_iteration_y = 5;
163 num_elems_written_per_iteration_x = 4;
164 num_elems_written_per_iteration_y = 3;
165 break;
166
167 default:
168 ARM_COMPUTE_ERROR("Current data type is not supported");
169 break;
170 }
171 }
172 // FIXME: Just keep one in release
173 else
174 {
175 switch(input->info()->data_type())
176 {
177 case DataType::F16:
Joel Liang63875432018-01-02 14:05:06 +0800178 options.emplace("#define PROCESS_4X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100179 num_elems_read_per_iteration_x = 8;
180 num_elems_written_per_iteration_x = 4;
181 break;
182
183 case DataType::F32:
184 // TODO(APPBROWSER-299): Choose the most optimal path and remove others.
Joel Liang63875432018-01-02 14:05:06 +0800185#define PROCESS_4X_1Y_1Z
Anthony Barbier7068f992017-10-26 15:23:08 +0100186
Joel Liang63875432018-01-02 14:05:06 +0800187#if defined(PROCESS_1X_1Y_1Z)
188 options.emplace("#define PROCESS_1X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100189 num_elems_read_per_iteration_x = 3;
190 num_elems_written_per_iteration_x = 1;
Joel Liang63875432018-01-02 14:05:06 +0800191#elif defined(PROCESS_4X_1Y_1Z)
192 options.emplace("#define PROCESS_4X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100193 num_elems_read_per_iteration_x = 8;
194 num_elems_written_per_iteration_x = 4;
Joel Liang63875432018-01-02 14:05:06 +0800195#elif defined(PROCESS_8X_1Y_1Z)
196 options.emplace("#define PROCESS_8X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100197 num_elems_read_per_iteration_x = 12;
198 num_elems_written_per_iteration_x = 8;
Joel Liang63875432018-01-02 14:05:06 +0800199#else /* PROCESS_nX_nY_nZ */
Anthony Barbier7068f992017-10-26 15:23:08 +0100200#error Have to declare how many elements to process in one thread.
Joel Liang63875432018-01-02 14:05:06 +0800201#endif /* PROCESS_nX_nY_nZ */
202#undef PROCESS_1X_1Y_1Z
203#undef PROCESS_4X_1Y_1Z
204#undef PROCESS_8X_1Y_1Z
Anthony Barbier7068f992017-10-26 15:23:08 +0100205 break;
206
207 default:
208 ARM_COMPUTE_ERROR("Current data type is not supported");
209 break;
210 }
211 }
212 }
213 else if(kernel_size == 1)
214 {
Xinghang Zhou4af62a02017-11-02 16:37:24 +0800215 if(weights->info()->dimension(2) % 2 == 0)
216 {
217 options.emplace("#define WEIGHTS_OPTIMIZATION");
218 }
Anthony Barbier7068f992017-10-26 15:23:08 +0100219 switch(input->info()->data_type())
220 {
221 case DataType::F16:
Xinghang Zhou4af62a02017-11-02 16:37:24 +0800222#define PROCESS_8X_2Y_1Z
223
224#if defined(PROCESS_4X_1Y_1Z)
225 options.emplace("#define PROCESS_4X_1Y_1Z");
226 num_elems_read_per_iteration_x = 4;
227 num_elems_written_per_iteration_x = 4;
228#elif defined(PROCESS_4X_2Y_1Z)
229 options.emplace("#define PROCESS_4X_2Y_1Z");
230 num_elems_read_per_iteration_x = 4;
231 num_elems_read_per_iteration_y = 2;
232 num_elems_written_per_iteration_x = 4;
233 num_elems_written_per_iteration_y = 2;
234#elif defined(PROCESS_4X_3Y_1Z)
235 options.emplace("#define PROCESS_4X_3Y_1Z");
236 num_elems_read_per_iteration_x = 4;
237 num_elems_read_per_iteration_y = 3;
238 num_elems_written_per_iteration_x = 4;
239 num_elems_written_per_iteration_y = 3;
240#elif defined(PROCESS_4X_4Y_1Z)
241 options.emplace("#define PROCESS_4X_4Y_1Z");
242 num_elems_read_per_iteration_x = 4;
243 num_elems_read_per_iteration_y = 4;
244 num_elems_written_per_iteration_x = 4;
245 num_elems_written_per_iteration_y = 4;
246#elif defined(PROCESS_4X_2Y_2Z)
247 ARM_COMPUTE_ERROR_ON_MSG((weights->info()->dimension(4) % 2) == 1, "Current 'weights->info()->dimension(4) % 2) == 1' is not supported");
248 options.emplace("#define PROCESS_4X_2Y_2Z");
249 num_elems_read_per_iteration_x = 4;
250 num_elems_read_per_iteration_y = 2;
251 num_elems_written_per_iteration_x = 4;
252 num_elems_written_per_iteration_y = 2;
253 num_elems_written_per_iteration_z = 2;
254#elif defined(PROCESS_8X_1Y_1Z)
255 options.emplace("#define PROCESS_8X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100256 num_elems_read_per_iteration_x = 8;
257 num_elems_written_per_iteration_x = 8;
Xinghang Zhou4af62a02017-11-02 16:37:24 +0800258#elif defined(PROCESS_8X_2Y_1Z)
259 options.emplace("#define PROCESS_8X_2Y_1Z");
260 num_elems_read_per_iteration_x = 8;
261 num_elems_read_per_iteration_y = 2;
262 num_elems_written_per_iteration_x = 8;
263 num_elems_written_per_iteration_y = 2;
264#else /* PROCESS_4X_1Y_1Z */
265#error Have to declare how many elements to process in one thread.
266#endif /* PROCESS_4X_1Y_1Z */
267#undef PROCESS_4X_1Y_1Z
268#undef PROCESS_4X_2Y_1Z
269#undef PROCESS_4X_3Y_1Z
270#undef PROCESS_4X_4Y_1Z
271#undef PROCESS_4X_2Y_2Z
272#undef PROCESS_8X_1Y_1Z
273#undef PROCESS_8X_2Y_1Z
Anthony Barbier7068f992017-10-26 15:23:08 +0100274 break;
275
276 case DataType::F32:
277 num_elems_read_per_iteration_x = 1;
278 num_elems_written_per_iteration_x = 1;
279 break;
280
281 default:
282 break;
283 }
284 }
285 else if(kernel_size == 5)
286 {
287 switch(input->info()->data_type())
288 {
289 case DataType::F16:
ASIAPAC\steli0123ac91b2017-11-07 16:14:44 +0800290 options.emplace("#define PROCESS_4X_1Y_1Z");
Anthony Barbier7068f992017-10-26 15:23:08 +0100291 num_elems_read_per_iteration_x = 8;
292 num_elems_written_per_iteration_x = 4;
293
294 default:
295 break;
296 }
297 }
298 else
299 {
300 }
301
302 if(_bias != nullptr)
303 {
304 options.emplace("#define BIAS");
305 }
306
307 std::stringstream kernel_name;
308 kernel_name << "direct_convolution" << kernel_size << "x" << kernel_size;
309
310 _kernel = static_cast<GCKernel>(GCKernelLibrary::get().create_kernel(kernel_name.str(), options));
311
Anthony Barbier7068f992017-10-26 15:23:08 +0100312 unsigned int idx = (_bias == nullptr) ? 3 * num_arguments_per_3D_tensor() : (num_arguments_per_1D_tensor() + 3 * num_arguments_per_3D_tensor());
313
314 // Calculate output right and bottom border
315 const int output_width = output->info()->dimension(0);
316 const int output_height = output->info()->dimension(1);
317 const int output_padding_right = ceil_to_multiple(output_width, num_elems_written_per_iteration_x * _lws[0]) - output_width;
318 const int output_padding_bottom = ceil_to_multiple(output_height, num_elems_written_per_iteration_y * _lws[1]) - output_height;
319
320 // Calculate input right and bottom border
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800321 const int input_width = input->info()->dimension(0);
322 const int input_height = input->info()->dimension(1);
323 const int input_total_width = std::max(int(input->info()->padding().left), int(_conv_pad_x)) + input_width + std::max(int(input->info()->padding().right), int(_conv_pad_x));
324 const int input_total_height = std::max(int(input->info()->padding().top), int(_conv_pad_y)) + input_height + std::max(int(input->info()->padding().bottom), int(_conv_pad_y));
325 const int padding_right1 = ceil_to_multiple(input_total_width, num_elems_read_per_iteration_x * _lws[0]) - input_width - _conv_pad_x;
326 const int padding_bottom1 = ceil_to_multiple(input_total_height, num_elems_read_per_iteration_y * _lws[1]) - input_height - _conv_pad_y;
327
328 const int upper_bound_w = ceil_to_multiple(((output_width + output_padding_right) * _conv_stride_x + (kernel_size - 1)), num_elems_read_per_iteration_x * _lws[0]) - _conv_pad_x - input_width;
329 const int upper_bound_h = ceil_to_multiple(((output_height + output_padding_bottom) * _conv_stride_y + (kernel_size - 1)), num_elems_read_per_iteration_y * _lws[1]) - _conv_pad_y - input_height;
330 const int padding_right2 = std::max(upper_bound_w, _conv_pad_x);
331 const int padding_bottom2 = std::max(upper_bound_h, _conv_pad_y);
332
333 const int padding_right = std::max(padding_right1, padding_right2);
334 const int padding_bottom = std::max(padding_bottom1, padding_bottom2);
Anthony Barbier7068f992017-10-26 15:23:08 +0100335
336 BorderSize border = BorderSize(0, output_padding_right, output_padding_bottom, 0);
337
338 Window win = calculate_max_enlarged_window(*output->info(), Steps(num_elems_written_per_iteration_x, num_elems_written_per_iteration_y, num_elems_written_per_iteration_z), border);
339
340 AccessWindowStatic input_access(input->info(), -_conv_pad_x, -_conv_pad_y, input_width + padding_right, input_height + padding_bottom);
341 AccessWindowStatic weights_access = AccessWindowStatic(nullptr, 0, 0, 0, 0);
342 AccessWindowStatic bias_access = AccessWindowStatic(nullptr, 0, 0, 0, 1);
343
344 switch(weights->info()->data_type())
345 {
346 case DataType::F16:
zhenglin666635c2017-12-04 14:38:09 +0800347 if((weights->info()->dimension(2) % 2 != 0) || (kernel_size != 1))
348 {
349 weights_access = AccessWindowStatic(weights->info(), 0, 0, kernel_size + 1, kernel_size);
350 }
Anthony Barbier7068f992017-10-26 15:23:08 +0100351 if(_bias != nullptr)
352 {
353 bias_access = AccessWindowStatic(_bias->info(), 0, 0, _bias->info()->dimension(0) + 1, 1);
354 }
355 break;
356
357 case DataType::F32:
358 weights_access = AccessWindowStatic(weights->info(), 0, 0, kernel_size, kernel_size);
359 if(_bias != nullptr)
360 {
361 bias_access = AccessWindowStatic(_bias->info(), 0, 0, _bias->info()->dimension(0), 1);
362 }
363 break;
364
365 default:
366 ARM_COMPUTE_ERROR("Current data type is not supported");
367 break;
368 }
369
370 AccessWindowStatic output_access(output->info(), 0, 0, output_width + output_padding_right, output_height + output_padding_bottom);
371
372 if(_bias != nullptr)
373 {
374 update_window_and_padding(win, input_access, weights_access, bias_access, output_access);
375 }
376 else
377 {
378 update_window_and_padding(win, input_access, weights_access, output_access);
379 }
380
381 output_access.set_valid_region(win, ValidRegion(Coordinates(), output->info()->tensor_shape()));
382
Joel Liangf1f3ebd2017-11-10 09:59:19 +0800383 _kernel.set_argument(idx++, _weights->info()->strides_in_bytes()[3]); // weights_stride_w
384 _kernel.set_argument(idx++, _weights->info()->dimension(2)); // weights_depth
Anthony Barbier7068f992017-10-26 15:23:08 +0100385
386 IGCKernel::configure(win);
387}
388
389template <unsigned int kernel_size>
390void GCDirectConvolutionLayerKernel<kernel_size>::run(const Window &window)
391{
392 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
393 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window);
394
395 _kernel.use();
396
397 // Get initial windows
398 Window slice = window.first_slice_window_3D();
399 Window win_in = window;
400
401 win_in.adjust(Window::DimX, -_conv_pad_x, true);
402 win_in.adjust(Window::DimY, -_conv_pad_y, true);
403 win_in.set_dimension_step(Window::DimX, window.x().step() * _conv_stride_x);
404 win_in.set_dimension_step(Window::DimY, window.y().step() * _conv_stride_y);
405
406 Window slice_in = win_in.first_slice_window_3D();
407
408 unsigned int idx1 = 2 * num_arguments_per_3D_tensor();
Joel Liangabd03cf2018-01-08 15:20:48 +0800409 add_3D_tensor_argument(idx1, _weights, 3, slice);
Anthony Barbier7068f992017-10-26 15:23:08 +0100410
411 if(_bias != nullptr)
412 {
413 Window slice_bias;
414 slice_bias.use_tensor_dimensions(_bias->info()->tensor_shape());
Joel Liangabd03cf2018-01-08 15:20:48 +0800415 add_1D_tensor_argument(idx1, _bias, 4, slice_bias);
Anthony Barbier7068f992017-10-26 15:23:08 +0100416 }
417
Xinghang Zhou33ff9ef2018-01-17 11:23:39 +0800418 slice.shift(Window::DimX, -(_output->info()->padding()).left);
419
Anthony Barbier7068f992017-10-26 15:23:08 +0100420 do
421 {
422 unsigned int idx = 0;
423
Joel Liangabd03cf2018-01-08 15:20:48 +0800424 add_3D_tensor_argument(idx, _input, 1, slice_in);
425 add_3D_tensor_argument(idx, _output, 2, slice);
Anthony Barbier7068f992017-10-26 15:23:08 +0100426
427 _kernel.update_shader_params();
428 enqueue(*this, slice, _lws);
429 }
430 while(window.slide_window_slice_3D(slice) && win_in.slide_window_slice_3D(slice_in));
431}
432
433template class arm_compute::GCDirectConvolutionLayerKernel<1>;
434template class arm_compute::GCDirectConvolutionLayerKernel<3>;
435template class arm_compute::GCDirectConvolutionLayerKernel<5>;