steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 1 | /* |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 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 | #include "arm_compute/core/CL/kernels/CLDirectConvolutionLayerKernel.h" |
| 25 | |
| 26 | #include "arm_compute/core/AccessWindowStatic.h" |
| 27 | #include "arm_compute/core/CL/CLHelpers.h" |
| 28 | #include "arm_compute/core/CL/CLKernelLibrary.h" |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 29 | #include "arm_compute/core/CL/CLValidate.h" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 30 | #include "arm_compute/core/CL/ICLTensor.h" |
| 31 | #include "arm_compute/core/Error.h" |
| 32 | #include "arm_compute/core/Helpers.h" |
| 33 | #include "arm_compute/core/IAccessWindow.h" |
| 34 | #include "arm_compute/core/ITensor.h" |
| 35 | #include "arm_compute/core/Types.h" |
Gian Marco Iodice | 5cb4d6a | 2017-08-08 10:53:00 +0100 | [diff] [blame] | 36 | #include "arm_compute/core/Utils.h" |
Giorgio Arena | c0f5443 | 2018-03-16 14:02:34 +0000 | [diff] [blame] | 37 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 38 | #include "arm_compute/core/utils/quantization/AsymmHelpers.h" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 39 | #include "support/ToolchainSupport.h" |
| 40 | |
| 41 | using namespace arm_compute; |
| 42 | |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 43 | namespace |
| 44 | { |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 45 | Status validate_arguments(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info) |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 46 | { |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 47 | ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(input); |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 48 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::F16, DataType::F32); |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 49 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 50 | |
| 51 | const DataLayout data_layout = input->data_layout(); |
| 52 | const int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 53 | const int height_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 54 | const int channel_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL); |
| 55 | |
| 56 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights->dimension(width_idx) != weights->dimension(height_idx), "Weights should have same width and height"); |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 57 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights->dimension(width_idx) != 1 && weights->dimension(width_idx) != 3 && weights->dimension(width_idx) != 5 && weights->dimension(width_idx) != 9, |
| 58 | "Kernel sizes other than 1x1, 3x3, 5x5 or 9x9 are not supported"); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 59 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights->dimension(channel_idx) != input->dimension(channel_idx), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 60 | "Weights feature map dimension should match the respective input's one"); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 61 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights->num_dimensions() > 4, "Weights can be at most 4 dimensional"); |
| 62 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((weights->dimension(width_idx) == 1) && std::get<0>(conv_info.stride()) > 3, "Strides larger than 3 not supported for 1x1 convolution."); |
| 63 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((weights->dimension(width_idx) == 3 || weights->dimension(width_idx) == 5) && std::get<0>(conv_info.stride()) > 2, |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 64 | "Strides larger than 2 not supported for 3x3 convolution."); |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame^] | 65 | |
| 66 | const auto data_type = input->data_type(); |
| 67 | |
| 68 | if(weights->dimension(width_idx) == 9) |
| 69 | { |
| 70 | const auto supported_data_layout = is_data_type_quantized(data_type) ? DataLayout::NCHW : DataLayout::NHWC; |
| 71 | const auto error_message = std::string("Only " + string_from_data_layout(supported_data_layout) + " layout is supported for 9x9 convolution with " + string_from_data_type( |
| 72 | data_type) + " type"); |
| 73 | |
| 74 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((supported_data_layout != data_layout), error_message.c_str()); |
| 75 | } |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 76 | |
| 77 | if(biases != nullptr) |
| 78 | { |
| 79 | if(is_data_type_quantized_asymmetric(input->data_type())) |
| 80 | { |
| 81 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::S32); |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(weights, biases); |
| 86 | } |
| 87 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(biases->dimension(0) != weights->dimension(3), |
| 88 | "Biases size and number of input feature maps should match"); |
| 89 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(biases->num_dimensions() > 1, |
| 90 | "Biases should be one dimensional"); |
| 91 | } |
| 92 | |
| 93 | // Checks performed when output is configured |
| 94 | if(output->total_size() != 0) |
| 95 | { |
| 96 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), |
Giorgio Arena | c0f5443 | 2018-03-16 14:02:34 +0000 | [diff] [blame] | 97 | misc::shape_calculator::compute_deep_convolution_shape(*input, *weights, conv_info)); |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 98 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output); |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 101 | return Status{}; |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 102 | } |
| 103 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 104 | inline bool can_run_optimized_kernel_for_bifrost(GPUTarget gpu_target, unsigned int conv_stride_x, unsigned int conv_stride_y, unsigned int kernel_size, |
| 105 | DataType data_type, DataLayout data_layout) |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 106 | { |
Georgios Pinitas | a34286e | 2018-09-04 12:18:50 +0100 | [diff] [blame] | 107 | return gpu_target_is_in(gpu_target, |
| 108 | GPUTarget::G71, GPUTarget::G72, GPUTarget::G76, |
| 109 | GPUTarget::G51, GPUTarget::G51BIG, GPUTarget::G51LIT, |
| 110 | GPUTarget::G52, GPUTarget::G52LIT) |
| 111 | && (kernel_size <= 5) |
| 112 | && (conv_stride_x == 1) && (conv_stride_y == 1) |
| 113 | && (data_type == DataType::F32) |
| 114 | && (data_layout == DataLayout::NCHW); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 115 | } |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 116 | |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 117 | inline bool can_run_optimized_kernel_for_bifrost_nhwc(GPUTarget gpu_target, unsigned int conv_stride_x, unsigned int conv_stride_y, unsigned int kernel_size, |
| 118 | DataType data_type, DataLayout data_layout) |
| 119 | { |
| 120 | return gpu_target_is_in(gpu_target, |
| 121 | GPUTarget::G71, GPUTarget::G72, GPUTarget::G76, |
| 122 | GPUTarget::G51, GPUTarget::G51BIG, GPUTarget::G51LIT, |
| 123 | GPUTarget::G52, GPUTarget::G52LIT) |
| 124 | && (kernel_size == 9) |
| 125 | && (conv_stride_x == 1) && (conv_stride_y == 1) |
| 126 | && (data_type == DataType::F32) |
| 127 | && (data_layout == DataLayout::NHWC); |
| 128 | } |
| 129 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 130 | inline void setup_num_elems(unsigned int &num_elems_read_per_iteration_x, unsigned int &num_elems_read_per_iteration_y, |
| 131 | unsigned int &num_elems_written_per_iteration_x, unsigned int &num_elems_written_per_iteration_y, |
| 132 | unsigned int kernel_size, const PadStrideInfo &conv_info, const GPUTarget target, ITensorInfo *input) |
| 133 | { |
| 134 | const DataType data_type = input->data_type(); |
| 135 | const DataLayout data_layout = input->data_layout(); |
| 136 | unsigned int conv_stride_x = std::get<0>(conv_info.stride()); |
| 137 | unsigned int conv_stride_y = std::get<1>(conv_info.stride()); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 138 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 139 | const bool run_optimized_bifrost = can_run_optimized_kernel_for_bifrost(target, conv_stride_x, conv_stride_y, kernel_size, data_type, data_layout); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 140 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 141 | if(run_optimized_bifrost) |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 142 | { |
| 143 | // Configure kernel window |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 144 | switch(kernel_size) |
| 145 | { |
| 146 | case 1: |
| 147 | { |
| 148 | num_elems_read_per_iteration_x = 4; |
| 149 | num_elems_read_per_iteration_y = 4; |
| 150 | num_elems_written_per_iteration_x = 4; |
| 151 | num_elems_written_per_iteration_y = 4; |
| 152 | break; |
| 153 | } |
| 154 | case 3: |
| 155 | { |
| 156 | num_elems_read_per_iteration_x = 6; |
| 157 | num_elems_read_per_iteration_y = 5; |
| 158 | num_elems_written_per_iteration_x = 4; |
| 159 | num_elems_written_per_iteration_y = 3; |
| 160 | break; |
| 161 | } |
| 162 | case 5: |
| 163 | { |
| 164 | num_elems_read_per_iteration_x = 8; |
| 165 | num_elems_read_per_iteration_y = 6; |
| 166 | num_elems_written_per_iteration_x = 4; |
| 167 | num_elems_written_per_iteration_y = 2; |
| 168 | break; |
| 169 | } |
| 170 | default: |
| 171 | { |
| 172 | ARM_COMPUTE_ERROR("Kernel size not optimized for Bifrost"); |
| 173 | } |
| 174 | } |
| 175 | } |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 176 | else if(data_layout == DataLayout::NCHW) |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 177 | { |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 178 | num_elems_read_per_iteration_y = kernel_size; |
| 179 | num_elems_written_per_iteration_x = 8; |
| 180 | num_elems_written_per_iteration_y = 1; |
Anthony Barbier | cc9fed5 | 2017-12-13 10:46:00 +0000 | [diff] [blame] | 181 | switch(kernel_size) |
| 182 | { |
| 183 | case 1: |
| 184 | switch(conv_stride_x) |
| 185 | { |
| 186 | case 1: |
| 187 | num_elems_read_per_iteration_x = 8; |
| 188 | break; |
| 189 | case 2: |
| 190 | num_elems_read_per_iteration_x = 16; |
| 191 | break; |
| 192 | case 3: |
| 193 | switch(input->element_size()) |
| 194 | { |
| 195 | case 1: |
| 196 | num_elems_read_per_iteration_x = 28; |
| 197 | break; |
| 198 | case 2: |
| 199 | num_elems_read_per_iteration_x = 24; |
| 200 | break; |
| 201 | case 4: |
| 202 | num_elems_read_per_iteration_x = 22; |
| 203 | break; |
| 204 | default: |
| 205 | ARM_COMPUTE_ERROR("Invalid data size"); |
| 206 | } |
| 207 | break; |
| 208 | default: |
| 209 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 210 | } |
| 211 | break; |
| 212 | case 3: |
| 213 | switch(conv_stride_x) |
| 214 | { |
| 215 | case 1: |
| 216 | num_elems_read_per_iteration_x = 10; |
| 217 | break; |
| 218 | case 2: |
| 219 | num_elems_read_per_iteration_x = 17; |
| 220 | break; |
| 221 | default: |
| 222 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 223 | } |
| 224 | break; |
| 225 | case 5: |
| 226 | switch(conv_stride_x) |
| 227 | { |
| 228 | case 1: |
| 229 | num_elems_read_per_iteration_x = 12; |
| 230 | break; |
| 231 | case 2: |
| 232 | num_elems_read_per_iteration_x = 20; |
| 233 | break; |
| 234 | default: |
| 235 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 236 | } |
| 237 | break; |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame^] | 238 | case 9: |
| 239 | switch(conv_stride_x) |
| 240 | { |
| 241 | case 1: |
| 242 | num_elems_read_per_iteration_x = 16; |
| 243 | break; |
| 244 | case 2: |
| 245 | num_elems_read_per_iteration_x = 24; |
| 246 | break; |
| 247 | default: |
| 248 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 249 | } |
| 250 | break; |
Anthony Barbier | cc9fed5 | 2017-12-13 10:46:00 +0000 | [diff] [blame] | 251 | default: |
| 252 | ARM_COMPUTE_ERROR("Invalid direct convolution size"); |
| 253 | } |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 254 | } |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 255 | else // data_layout == NHWC |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 256 | { |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 257 | const bool run_optimized_bifrost_nhwc = can_run_optimized_kernel_for_bifrost_nhwc(target, conv_stride_x, conv_stride_y, kernel_size, data_type, data_layout); |
| 258 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 259 | num_elems_written_per_iteration_x = 1; |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 260 | |
| 261 | if(run_optimized_bifrost_nhwc) |
| 262 | { |
| 263 | num_elems_read_per_iteration_x = 4; |
| 264 | } |
giuros01 | c878f1f | 2019-07-09 11:01:34 +0100 | [diff] [blame] | 265 | else |
| 266 | { |
| 267 | num_elems_read_per_iteration_x = 1; |
| 268 | } |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 269 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 270 | switch(kernel_size) |
| 271 | { |
| 272 | case 1: |
| 273 | switch(conv_stride_x) |
| 274 | { |
| 275 | case 1: |
| 276 | num_elems_read_per_iteration_y = 8; |
| 277 | num_elems_written_per_iteration_y = 8; |
| 278 | break; |
| 279 | case 2: |
| 280 | num_elems_read_per_iteration_y = 16; |
| 281 | num_elems_written_per_iteration_y = 8; |
| 282 | break; |
| 283 | default: |
| 284 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 285 | } |
| 286 | break; |
| 287 | case 3: |
| 288 | switch(conv_stride_x) |
| 289 | { |
| 290 | case 1: |
| 291 | num_elems_read_per_iteration_y = 10; |
| 292 | num_elems_written_per_iteration_y = 8; |
| 293 | break; |
| 294 | case 2: |
| 295 | num_elems_read_per_iteration_y = 17; |
| 296 | num_elems_written_per_iteration_y = 8; |
| 297 | break; |
| 298 | default: |
| 299 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 300 | } |
| 301 | break; |
| 302 | case 5: |
| 303 | switch(conv_stride_x) |
| 304 | { |
| 305 | case 1: |
| 306 | num_elems_read_per_iteration_y = 12; |
| 307 | num_elems_written_per_iteration_y = 8; |
| 308 | break; |
| 309 | case 2: |
| 310 | num_elems_read_per_iteration_y = 20; |
| 311 | num_elems_written_per_iteration_y = 8; |
| 312 | break; |
| 313 | default: |
| 314 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 315 | } |
| 316 | break; |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 317 | case 9: |
| 318 | switch(conv_stride_x) |
| 319 | { |
| 320 | case 1: |
| 321 | num_elems_read_per_iteration_y = 16; |
| 322 | num_elems_written_per_iteration_y = 8; |
| 323 | break; |
| 324 | case 2: |
| 325 | num_elems_read_per_iteration_y = 24; |
| 326 | num_elems_written_per_iteration_y = 8; |
| 327 | break; |
| 328 | default: |
| 329 | ARM_COMPUTE_ERROR("Invalid convolution stride X"); |
| 330 | } |
| 331 | break; |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 332 | default: |
| 333 | ARM_COMPUTE_ERROR("Not implemented."); |
| 334 | break; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITensorInfo *weights, ITensorInfo *output, const PadStrideInfo &conv_info, const GPUTarget target) |
| 340 | { |
| 341 | const DataLayout data_layout = input->data_layout(); |
| 342 | const int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 343 | const unsigned int kernel_size = weights->dimension(width_idx); |
| 344 | |
| 345 | // Get convolved dimensions |
| 346 | TensorShape output_shape = misc::shape_calculator::compute_deep_convolution_shape(*input, *weights, conv_info); |
| 347 | |
| 348 | // Output auto inizialitation if not yet initialized |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 349 | // TODO(COMPMID-2078): input->clone()->set_tensor_shape(output_shape) doesn't work with subtensors for grouped direct convolutions (AlexNet). |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 350 | auto_init_if_empty(*output, output_shape, |
| 351 | 1, |
| 352 | input->data_type(), |
| 353 | input->quantization_info()); |
| 354 | |
| 355 | unsigned int num_elems_read_per_iteration_x = 0; |
| 356 | unsigned int num_elems_read_per_iteration_y = 0; |
| 357 | unsigned int num_elems_written_per_iteration_x = 0; |
| 358 | unsigned int num_elems_written_per_iteration_y = 0; |
| 359 | |
| 360 | unsigned int conv_pad_left = conv_info.pad_left(); |
| 361 | unsigned int conv_pad_top = conv_info.pad_top(); |
| 362 | unsigned int conv_stride_x = std::get<0>(conv_info.stride()); |
| 363 | unsigned int conv_stride_y = std::get<1>(conv_info.stride()); |
| 364 | |
| 365 | setup_num_elems(num_elems_read_per_iteration_x, num_elems_read_per_iteration_y, |
| 366 | num_elems_written_per_iteration_x, num_elems_written_per_iteration_y, |
| 367 | kernel_size, conv_info, target, input); |
| 368 | |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 369 | // Create window and update padding |
Anthony Barbier | cc9fed5 | 2017-12-13 10:46:00 +0000 | [diff] [blame] | 370 | bool window_changed = false; |
| 371 | Window win = calculate_max_window(*output, Steps(num_elems_written_per_iteration_x, num_elems_written_per_iteration_y)); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 372 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 373 | if(data_layout == DataLayout::NHWC) |
| 374 | { |
| 375 | AccessWindowStatic input_access(input, 0, -conv_pad_left, |
giuros01 | c878f1f | 2019-07-09 11:01:34 +0100 | [diff] [blame] | 376 | ceil_to_multiple(input->dimension(0), num_elems_read_per_iteration_x), |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 377 | ceil_to_multiple(input->dimension(1) + conv_info.pad_right(), num_elems_read_per_iteration_y)); |
| 378 | AccessWindowStatic weights_access(weights, 0, 0, weights->dimension(0), weights->dimension(1)); |
| 379 | AccessWindowRectangle output_access(output, 0, 0, num_elems_written_per_iteration_x, num_elems_written_per_iteration_y); |
| 380 | window_changed = update_window_and_padding(win, input_access, weights_access, output_access); |
| 381 | output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape())); |
| 382 | Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; |
| 383 | return std::make_pair(err, win); |
| 384 | } |
| 385 | else if(data_layout == DataLayout::NCHW) |
| 386 | { |
| 387 | AccessWindowRectangle input_access(input, -conv_pad_left, -conv_pad_top, num_elems_read_per_iteration_x, num_elems_read_per_iteration_y, conv_stride_x, conv_stride_y); |
| 388 | AccessWindowStatic weights_access(weights, 0, 0, kernel_size, kernel_size); |
| 389 | AccessWindowRectangle output_access(output, 0, 0, num_elems_written_per_iteration_x, num_elems_written_per_iteration_y); |
| 390 | window_changed = update_window_and_padding(win, input_access, weights_access, output_access); |
| 391 | output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape())); |
| 392 | Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; |
| 393 | return std::make_pair(err, win); |
| 394 | } |
| 395 | else |
| 396 | { |
| 397 | ARM_COMPUTE_ERROR("Not supported"); |
| 398 | } |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 399 | } |
| 400 | } // namespace |
| 401 | |
| 402 | CLDirectConvolutionLayerKernel::CLDirectConvolutionLayerKernel() |
| 403 | : _input(nullptr), _biases(nullptr), _weights(nullptr), _output(nullptr), _border_size(0), _conv_stride_x(0), _conv_stride_y(0) |
| 404 | { |
| 405 | } |
| 406 | |
| 407 | BorderSize CLDirectConvolutionLayerKernel::border_size() const |
| 408 | { |
| 409 | return _border_size; |
| 410 | } |
| 411 | |
| 412 | void CLDirectConvolutionLayerKernel::configure(const ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info) |
| 413 | { |
| 414 | ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, output); |
| 415 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 416 | const DataLayout data_layout = input->info()->data_layout(); |
| 417 | const int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 418 | const int height_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 419 | const int channel_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL); |
| 420 | |
| 421 | const unsigned int kernel_size = weights->info()->dimension(width_idx); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 422 | const DataType data_type = input->info()->data_type(); |
| 423 | |
| 424 | // Get convolved dimensions |
Giorgio Arena | c0f5443 | 2018-03-16 14:02:34 +0000 | [diff] [blame] | 425 | TensorShape output_shape = misc::shape_calculator::compute_deep_convolution_shape(*input->info(), *weights->info(), conv_info); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 426 | |
| 427 | // Output auto inizialitation if not yet initialized |
Georgios Pinitas | f52cd78 | 2019-03-25 14:06:14 +0000 | [diff] [blame] | 428 | // TODO(COMPMID-2078): input->clone()->set_tensor_shape(output_shape) doesn't work with subtensors for grouped direct convolutions (AlexNet). |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 429 | auto_init_if_empty(*output->info(), |
| 430 | output_shape, |
| 431 | 1, |
| 432 | input->info()->data_type(), |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 433 | input->info()->quantization_info()); |
| 434 | |
| 435 | // Perform validation step |
| 436 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), |
| 437 | weights->info(), |
| 438 | (biases != nullptr) ? biases->info() : nullptr, |
| 439 | output->info(), |
| 440 | conv_info)); |
| 441 | |
| 442 | _conv_stride_x = std::get<0>(conv_info.stride()); |
| 443 | _conv_stride_y = std::get<1>(conv_info.stride()); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 444 | |
| 445 | if(data_layout == DataLayout::NHWC) |
| 446 | { |
| 447 | _border_size = BorderSize(conv_info.pad_left(), 0, conv_info.pad_right(), 0); |
| 448 | } |
| 449 | else if(data_layout == DataLayout::NCHW) |
| 450 | { |
| 451 | _border_size = BorderSize(conv_info.pad_top(), conv_info.pad_right(), conv_info.pad_bottom(), conv_info.pad_left()); |
| 452 | } |
| 453 | else |
| 454 | { |
| 455 | ARM_COMPUTE_ERROR("Not supported"); |
| 456 | } |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 457 | |
| 458 | _input = input; |
| 459 | _weights = weights; |
| 460 | _output = output; |
| 461 | _biases = biases; |
| 462 | |
Michalis Spyrou | a967611 | 2018-02-22 18:07:43 +0000 | [diff] [blame] | 463 | const GPUTarget gpu_target = get_target(); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 464 | |
| 465 | std::stringstream kernel_name; |
| 466 | kernel_name << "direct_convolution" << kernel_size << "x" << kernel_size; |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 467 | if(data_layout == DataLayout::NHWC) |
| 468 | { |
| 469 | kernel_name << "_" << lower_string(string_from_data_layout(data_layout)); |
| 470 | } |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 471 | |
| 472 | CLBuildOptions build_options; |
| 473 | build_options.add_option_if(_biases != nullptr, std::string("-DHAS_BIAS")); |
| 474 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 475 | const bool run_optimized_for_bifrost = can_run_optimized_kernel_for_bifrost(gpu_target, _conv_stride_x, _conv_stride_y, kernel_size, data_type, data_layout); |
| 476 | |
| 477 | if(run_optimized_for_bifrost) |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 478 | { |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 479 | build_options.add_option(std::string("-DWEIGHTS_DEPTH=" + support::cpp11::to_string(_weights->info()->dimension(channel_idx)))); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 480 | |
| 481 | kernel_name << "_f32_bifrost"; |
| 482 | _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name.str(), build_options.options())); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 483 | } |
| 484 | else |
| 485 | { |
Pablo Tello | d041a83 | 2018-10-03 17:11:09 +0100 | [diff] [blame] | 486 | const bool is_quantized_asymm = is_data_type_quantized_asymmetric(data_type); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 487 | build_options.add_option_if(is_quantized_asymm, std::string("-DKERNEL_SIZE=" + support::cpp11::to_string(kernel_size))); |
| 488 | build_options.add_option(std::string("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type))); |
| 489 | build_options.add_option(std::string("-DDATA_SIZE=" + get_data_size_from_data_type(data_type))); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 490 | build_options.add_option(std::string("-DWEIGHTS_DEPTH=" + support::cpp11::to_string(_weights->info()->dimension(channel_idx)))); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 491 | build_options.add_option(std::string("-DSTRIDE_X=" + support::cpp11::to_string(_conv_stride_x))); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 492 | if(data_layout == DataLayout::NHWC) |
| 493 | { |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 494 | const bool run_optimized_for_bifrost_nhwc = can_run_optimized_kernel_for_bifrost_nhwc(gpu_target, _conv_stride_x, _conv_stride_y, kernel_size, data_type, data_layout); |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 495 | build_options.add_option(std::string("-DDATA_LAYOUT_NHWC=1")); |
| 496 | build_options.add_option(std::string("-DDST_HEIGHT=" + support::cpp11::to_string(_output->info()->dimension(height_idx)))); |
| 497 | build_options.add_option(std::string("-DDST_WIDTH=" + support::cpp11::to_string(_output->info()->dimension(width_idx)))); |
| 498 | build_options.add_option(std::string("-DSRC_HEIGHT=" + support::cpp11::to_string(_input->info()->dimension(height_idx)))); |
| 499 | build_options.add_option(std::string("-DSRC_WIDTH=" + support::cpp11::to_string(_input->info()->dimension(width_idx)))); |
| 500 | build_options.add_option(std::string("-DPAD_LEFT=" + support::cpp11::to_string(conv_info.pad_left()))); |
| 501 | build_options.add_option(std::string("-DPAD_TOP=" + support::cpp11::to_string(conv_info.pad_top()))); |
| 502 | build_options.add_option(std::string("-DSTRIDE_Y=" + support::cpp11::to_string(_conv_stride_y))); |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 503 | if(run_optimized_for_bifrost_nhwc) |
| 504 | { |
| 505 | const unsigned int num_elems_read_per_iteration_x = 4; |
| 506 | _border_size.right = num_elems_read_per_iteration_x; |
| 507 | build_options.add_option("-DVEC_SIZE=" + support::cpp11::to_string(num_elems_read_per_iteration_x)); |
| 508 | } |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 509 | } |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 510 | build_options.add_option(std::string("-DDATA_TYPE_PROMOTED=" + get_cl_type_from_data_type(data_type))); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 511 | // Create kernel |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame^] | 512 | _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(is_quantized_asymm ? "direct_convolution_quantized" : kernel_name.str(), |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 513 | build_options.options())); |
| 514 | } |
| 515 | |
| 516 | // Configure kernel window |
| 517 | auto win_config = validate_and_configure_window(input->info(), weights->info(), output->info(), conv_info, gpu_target); |
| 518 | ARM_COMPUTE_ERROR_THROW_ON(win_config.first); |
Anthony Barbier | b6eb353 | 2018-08-08 13:20:04 +0100 | [diff] [blame] | 519 | ICLKernel::configure_internal(win_config.second); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 520 | |
| 521 | // Set static kernel arguments |
| 522 | if(is_data_type_quantized_asymmetric(data_type)) |
| 523 | { |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 524 | const UniformQuantizationInfo iqinfo = _input->info()->quantization_info().uniform(); |
| 525 | const UniformQuantizationInfo wqinfo = _weights->info()->quantization_info().uniform(); |
| 526 | const UniformQuantizationInfo oqinfo = _output->info()->quantization_info().uniform(); |
| 527 | |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 528 | int output_multiplier = 0; |
| 529 | int output_shift = 0; |
| 530 | |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 531 | float multiplier = iqinfo.scale * wqinfo.scale / oqinfo.scale; |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 532 | ARM_COMPUTE_THROW_ON_ERROR(quantization::calculate_quantized_multiplier_less_than_one(multiplier, &output_multiplier, &output_shift)); |
| 533 | |
| 534 | unsigned int idx = 3 * num_arguments_per_3D_tensor() + ((_biases != nullptr) ? num_arguments_per_1D_tensor() : 0) + 1; |
Georgios Pinitas | 4c5469b | 2019-05-21 13:32:43 +0100 | [diff] [blame] | 535 | _kernel.setArg(idx++, -iqinfo.offset); |
| 536 | _kernel.setArg(idx++, -wqinfo.offset); |
| 537 | _kernel.setArg(idx++, oqinfo.offset); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 538 | _kernel.setArg(idx++, output_multiplier); |
| 539 | _kernel.setArg(idx++, output_shift); |
| 540 | } |
| 541 | |
| 542 | // Set config_id for enabling LWS tuning |
| 543 | _config_id = "direct_convolution_"; |
| 544 | _config_id += lower_string(string_from_data_type(data_type)); |
| 545 | _config_id += "_"; |
| 546 | _config_id += support::cpp11::to_string(kernel_size); |
| 547 | _config_id += "_"; |
Georgios Pinitas | 1599787 | 2018-02-19 13:58:22 +0000 | [diff] [blame] | 548 | _config_id += support::cpp11::to_string(border_size().left); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 549 | _config_id += "_"; |
Georgios Pinitas | 1599787 | 2018-02-19 13:58:22 +0000 | [diff] [blame] | 550 | _config_id += support::cpp11::to_string(border_size().top); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 551 | _config_id += "_"; |
Georgios Pinitas | 1599787 | 2018-02-19 13:58:22 +0000 | [diff] [blame] | 552 | _config_id += support::cpp11::to_string(border_size().right); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 553 | _config_id += "_"; |
Georgios Pinitas | 1599787 | 2018-02-19 13:58:22 +0000 | [diff] [blame] | 554 | _config_id += support::cpp11::to_string(border_size().bottom); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 555 | _config_id += "_"; |
| 556 | _config_id += support::cpp11::to_string(_conv_stride_x); |
| 557 | _config_id += "_"; |
| 558 | _config_id += support::cpp11::to_string(_conv_stride_y); |
| 559 | _config_id += "_"; |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 560 | _config_id += support::cpp11::to_string(output->info()->dimension(width_idx)); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 561 | _config_id += "_"; |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 562 | _config_id += support::cpp11::to_string(output->info()->dimension(height_idx)); |
| 563 | _config_id += "_"; |
| 564 | _config_id += lower_string(string_from_data_layout(data_layout)); |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 565 | } |
| 566 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 567 | Status CLDirectConvolutionLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, |
| 568 | const GPUTarget target) |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 569 | { |
| 570 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, weights, biases, output, conv_info)); |
| 571 | ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), weights->clone().get(), output->clone().get(), conv_info, target).first); |
| 572 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 573 | return Status{}; |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 574 | } |
| 575 | |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 576 | void CLDirectConvolutionLayerKernel::run(const Window &window, cl::CommandQueue &queue) |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 577 | { |
| 578 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 579 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window); |
| 580 | |
| 581 | // Get initial windows |
| 582 | Window slice = window.first_slice_window_3D(); |
| 583 | Window win_in = window; |
| 584 | |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 585 | win_in.adjust(Window::DimX, -_border_size.left, true); |
| 586 | win_in.adjust(Window::DimY, -_border_size.top, true); |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 587 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 588 | const DataLayout data_layout = _input->info()->data_layout(); |
| 589 | const int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 590 | const int height_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 591 | |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 592 | win_in.set_dimension_step(width_idx, window[width_idx].step() * _conv_stride_x); |
| 593 | win_in.set_dimension_step(height_idx, window[height_idx].step() * _conv_stride_y); |
| 594 | |
| 595 | Window slice_in = win_in.first_slice_window_3D(); |
| 596 | unsigned int idx1 = 2 * num_arguments_per_3D_tensor(); |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 597 | add_3D_tensor_argument(idx1, _weights, slice); |
| 598 | |
| 599 | if(_biases != nullptr) |
| 600 | { |
| 601 | Window slice_biases; |
SiCong Li | 86b5333 | 2017-08-23 11:02:43 +0100 | [diff] [blame] | 602 | slice_biases.use_tensor_dimensions(_biases->info()->tensor_shape()); |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 603 | add_1D_tensor_argument(idx1, _biases, slice_biases); |
| 604 | } |
| 605 | |
Gian Marco Iodice | 5cb4d6a | 2017-08-08 10:53:00 +0100 | [diff] [blame] | 606 | _kernel.setArg(idx1++, static_cast<unsigned int>(_weights->info()->strides_in_bytes()[3])); |
| 607 | |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 608 | do |
| 609 | { |
| 610 | unsigned int idx = 0; |
| 611 | add_3D_tensor_argument(idx, _input, slice_in); |
| 612 | add_3D_tensor_argument(idx, _output, slice); |
Anthony Barbier | b6eb353 | 2018-08-08 13:20:04 +0100 | [diff] [blame] | 613 | enqueue(queue, *this, slice, lws_hint()); |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 614 | } |
| 615 | while(window.slide_window_slice_3D(slice) && win_in.slide_window_slice_3D(slice_in)); |
| 616 | } |