Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 Arm Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +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/CLBatchNormalizationLayerKernel.h" |
| 25 | |
| 26 | #include "arm_compute/core/CL/CLHelpers.h" |
| 27 | #include "arm_compute/core/CL/CLKernelLibrary.h" |
| 28 | #include "arm_compute/core/CL/ICLTensor.h" |
| 29 | #include "arm_compute/core/Helpers.h" |
| 30 | #include "arm_compute/core/TensorInfo.h" |
| 31 | #include "arm_compute/core/Utils.h" |
Sang-Hoon Park | 68dd25f | 2020-10-19 16:00:11 +0100 | [diff] [blame] | 32 | #include "src/core/CL/CLValidate.h" |
| 33 | #include "src/core/helpers/AutoConfiguration.h" |
| 34 | #include "src/core/helpers/WindowHelpers.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 35 | |
Matthew Bentham | 758b5ba | 2020-03-05 23:37:48 +0000 | [diff] [blame] | 36 | #include "support/StringSupport.h" |
Michalis Spyrou | 172e570 | 2017-06-26 14:18:47 +0100 | [diff] [blame] | 37 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 38 | using namespace arm_compute; |
| 39 | |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 40 | namespace |
| 41 | { |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 42 | Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, |
| 43 | const ITensorInfo *mean, const ITensorInfo *var, |
| 44 | const ITensorInfo *beta, const ITensorInfo *gamma, |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 45 | float epsilon, ActivationLayerInfo act_info) |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 46 | { |
| 47 | ARM_COMPUTE_UNUSED(epsilon); |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 48 | ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(input); |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 49 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 50 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(mean, var); |
| 51 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, mean, var); |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 52 | ARM_COMPUTE_RETURN_ERROR_ON(input->dimension(get_data_layout_dimension_index(input->data_layout(), DataLayoutDimension::CHANNEL)) != mean->dimension(0)); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 53 | if(beta != nullptr) |
| 54 | { |
| 55 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(mean, beta); |
| 56 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, beta); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 57 | } |
| 58 | if(gamma != nullptr) |
| 59 | { |
| 60 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(mean, gamma); |
| 61 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, gamma); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 62 | } |
| 63 | |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 64 | if(act_info.enabled()) |
| 65 | { |
| 66 | ActivationLayerInfo::ActivationFunction act = act_info.activation(); |
| 67 | ARM_COMPUTE_RETURN_ERROR_ON(input->data_type() != DataType::F32 && input->data_type() != DataType::F16); |
Georgios Pinitas | 6f109bd | 2018-07-16 12:57:42 +0100 | [diff] [blame] | 68 | ARM_COMPUTE_RETURN_ERROR_ON(act != ActivationLayerInfo::ActivationLayerInfo::ActivationFunction::RELU |
| 69 | && act != ActivationLayerInfo::ActivationLayerInfo::ActivationFunction::BOUNDED_RELU |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 70 | && act != ActivationLayerInfo::ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU); |
| 71 | ARM_COMPUTE_RETURN_ERROR_ON(act_info.b() > act_info.a()); |
| 72 | } |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 73 | |
| 74 | if(output != nullptr && output->total_size() != 0) |
| 75 | { |
| 76 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(input, output); |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 77 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(input, output); |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 78 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output); |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 79 | } |
| 80 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 81 | return Status{}; |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 82 | } |
| 83 | |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 84 | std::pair<Status, Window> validate_and_configure_window_nchw(ITensorInfo *input, ITensorInfo *output) |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 85 | { |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 86 | const unsigned int num_elems_processed_per_iteration = adjust_vec_size(16 / input->element_size(), input->dimension(0)); |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 87 | |
| 88 | // Configure kernel window |
| 89 | Window win = calculate_max_window(*input, Steps(num_elems_processed_per_iteration)); |
| 90 | AccessWindowHorizontal input_access(input, 0, num_elems_processed_per_iteration); |
| 91 | |
Giorgio Arena | 2995f5b | 2017-11-29 17:33:59 +0000 | [diff] [blame] | 92 | bool window_changed = false; |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 93 | if(output != nullptr) |
| 94 | { |
| 95 | AccessWindowHorizontal output_access(output, 0, num_elems_processed_per_iteration); |
| 96 | window_changed = update_window_and_padding(win, input_access, output_access); |
| 97 | output_access.set_valid_region(win, input->valid_region()); |
| 98 | } |
| 99 | else |
| 100 | { |
| 101 | window_changed = update_window_and_padding(win, input_access); |
| 102 | } |
| 103 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 104 | Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 105 | return std::make_pair(err, win); |
| 106 | } |
| 107 | } // namespace |
| 108 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 109 | CLBatchNormalizationLayerKernel::CLBatchNormalizationLayerKernel() |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 110 | : _input(nullptr), _output(nullptr), _mean(nullptr), _var(nullptr), _beta(nullptr), _gamma(nullptr), _epsilon(0), _run_in_place(false) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 111 | { |
| 112 | } |
| 113 | |
Georgios Pinitas | 409ee0a | 2017-08-18 10:16:09 +0100 | [diff] [blame] | 114 | void CLBatchNormalizationLayerKernel::configure(ICLTensor *input, ICLTensor *output, const ICLTensor *mean, const ICLTensor *var, const ICLTensor *beta, const ICLTensor *gamma, |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 115 | float epsilon, ActivationLayerInfo act_info) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 116 | { |
Manuel Bottini | 4c6bd51 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 117 | configure(CLKernelLibrary::get().get_compile_context(), input, output, mean, var, beta, gamma, epsilon, act_info); |
| 118 | } |
| 119 | |
Manuel Bottini | 256c0b9 | 2020-04-21 13:29:30 +0100 | [diff] [blame] | 120 | void CLBatchNormalizationLayerKernel::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, const ICLTensor *mean, const ICLTensor *var, const ICLTensor *beta, |
Manuel Bottini | 4c6bd51 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 121 | const ICLTensor *gamma, |
| 122 | float epsilon, ActivationLayerInfo act_info) |
| 123 | { |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 124 | ARM_COMPUTE_ERROR_ON_NULLPTR(input, mean, var); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 125 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 126 | _input = input; |
| 127 | _output = output; |
| 128 | _mean = mean; |
| 129 | _var = var; |
| 130 | _beta = beta; |
| 131 | _gamma = gamma; |
| 132 | _epsilon = epsilon; |
| 133 | |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 134 | _run_in_place = (output == nullptr) || (output == input); |
| 135 | |
Giorgio Arena | f6a43c5 | 2017-12-01 12:16:25 +0000 | [diff] [blame] | 136 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), (output != nullptr) ? output->info() : nullptr, |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 137 | mean->info(), var->info(), (beta != nullptr) ? beta->info() : nullptr, |
| 138 | (gamma != nullptr) ? gamma->info() : nullptr, epsilon, act_info)); |
Georgios Pinitas | 409ee0a | 2017-08-18 10:16:09 +0100 | [diff] [blame] | 139 | |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 140 | unsigned int num_elems_processed_per_iteration = adjust_vec_size(16 / input->info()->element_size(), input->info()->dimension(0)); |
Michalis Spyrou | 172e570 | 2017-06-26 14:18:47 +0100 | [diff] [blame] | 141 | |
| 142 | // Set build options |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 143 | CLBuildOptions build_opts; |
| 144 | build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type())); |
| 145 | build_opts.add_option("-DVEC_SIZE=" + support::cpp11::to_string(num_elems_processed_per_iteration)); |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 146 | build_opts.add_option("-DVEC_SIZE_LEFTOVER=" + support::cpp11::to_string(input->info()->dimension(0) % num_elems_processed_per_iteration)); |
Usama Arif | 6a98a6e | 2019-05-10 17:07:27 +0100 | [diff] [blame] | 147 | build_opts.add_option("-DACTIVATION_TYPE=" + lower_string(string_from_activation_func(act_info.activation()))); |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 148 | build_opts.add_option_if(act_info.enabled(), "-DA_VAL=" + float_to_string_with_full_precision(act_info.a())); |
| 149 | build_opts.add_option_if(act_info.enabled(), "-DB_VAL=" + float_to_string_with_full_precision(act_info.b())); |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 150 | build_opts.add_option_if(_run_in_place, "-DIN_PLACE"); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 151 | build_opts.add_option_if(beta == nullptr, "-DUSE_DEFAULT_BETA"); |
| 152 | build_opts.add_option_if(gamma == nullptr, "-DUSE_DEFAULT_GAMMA"); |
Michalis Spyrou | 172e570 | 2017-06-26 14:18:47 +0100 | [diff] [blame] | 153 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 154 | // Create kernel |
Manuel Bottini | 4c6bd51 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 155 | _kernel = create_kernel(compile_context, "batchnormalization_layer_" + lower_string(string_from_data_layout(input->info()->data_layout())), build_opts.options()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 156 | |
| 157 | // Set kernel static arguments |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 158 | unsigned int include_output = (!_run_in_place) ? 1 : 0; |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 159 | unsigned int idx = (1 + include_output) * num_arguments_per_3D_tensor() + 2 * num_arguments_per_1D_tensor(); // Skip the input and output parameters |
| 160 | if(_beta != nullptr) |
| 161 | { |
| 162 | idx += num_arguments_per_1D_tensor(); // Skip beta parameter |
| 163 | } |
| 164 | if(_gamma != nullptr) |
| 165 | { |
| 166 | idx += num_arguments_per_1D_tensor(); // Skip gamma parameter |
| 167 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 168 | _kernel.setArg<cl_float>(idx++, _epsilon); |
| 169 | |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 170 | if(output != nullptr) |
| 171 | { |
| 172 | // Output tensor auto initialization if not yet initialized |
| 173 | auto_init_if_empty(*output->info(), *input->info()->clone()); |
| 174 | } |
| 175 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 176 | // Configure kernel window |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 177 | if(input->info()->data_layout() == DataLayout::NHWC) |
| 178 | { |
| 179 | Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration)); |
| 180 | ICLKernel::configure_internal(win); |
| 181 | } |
| 182 | else |
| 183 | { |
| 184 | auto win_config = validate_and_configure_window_nchw(input->info(), (_run_in_place) ? nullptr : output->info()); |
| 185 | ARM_COMPUTE_ERROR_THROW_ON(win_config.first); |
| 186 | ICLKernel::configure_internal(win_config.second); |
| 187 | } |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 188 | |
| 189 | _config_id = "batch_normalization_layer_"; |
| 190 | _config_id += string_from_data_type(input->info()->data_type()); |
| 191 | _config_id += "_"; |
| 192 | _config_id += support::cpp11::to_string(input->info()->dimension(0)); |
| 193 | _config_id += "_"; |
| 194 | _config_id += support::cpp11::to_string(input->info()->dimension(1)); |
| 195 | _config_id += "_"; |
| 196 | _config_id += support::cpp11::to_string(input->info()->dimension(2)); |
Giorgio Arena | 00b93f5 | 2018-06-28 17:18:50 +0100 | [diff] [blame] | 197 | _config_id += "_"; |
| 198 | _config_id += lower_string(string_from_data_layout(input->info()->data_layout())); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 199 | } |
| 200 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 201 | Status CLBatchNormalizationLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output, |
| 202 | const ITensorInfo *mean, const ITensorInfo *var, |
| 203 | const ITensorInfo *beta, const ITensorInfo *gamma, |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 204 | float epsilon, ActivationLayerInfo act_info) |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 205 | { |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 206 | const bool run_in_place = (output == nullptr) || (output == input); |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 207 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, mean, var, beta, gamma, epsilon, act_info)); |
Sheri Zhang | 141c31a | 2020-10-08 12:35:28 +0100 | [diff] [blame] | 208 | |
| 209 | if(input->data_layout() != DataLayout::NHWC) |
| 210 | { |
| 211 | ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window_nchw(input->clone().get(), (run_in_place) ? nullptr : output->clone().get()) |
| 212 | .first); |
| 213 | } |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 214 | |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 215 | return Status{}; |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 216 | } |
| 217 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 218 | void CLBatchNormalizationLayerKernel::run(const Window &window, cl::CommandQueue &queue) |
| 219 | { |
| 220 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 221 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window); |
| 222 | |
| 223 | Window slice = window.first_slice_window_3D(); |
| 224 | |
| 225 | Window vector_slice = window.first_slice_window_1D(); |
| 226 | vector_slice.set(Window::DimX, Window::Dimension(0, 0, 0)); |
| 227 | |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 228 | unsigned int include_output = (!_run_in_place) ? 1 : 0; |
Georgios Pinitas | 236bfe7 | 2017-11-23 15:59:55 +0000 | [diff] [blame] | 229 | unsigned int idx = (1 + include_output) * num_arguments_per_3D_tensor(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 230 | add_1D_tensor_argument(idx, _mean, vector_slice); |
| 231 | add_1D_tensor_argument(idx, _var, vector_slice); |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 232 | if(_beta != nullptr) |
| 233 | { |
| 234 | add_1D_tensor_argument(idx, _beta, vector_slice); |
| 235 | } |
| 236 | if(_gamma != nullptr) |
| 237 | { |
| 238 | add_1D_tensor_argument(idx, _gamma, vector_slice); |
| 239 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 240 | |
| 241 | do |
| 242 | { |
| 243 | idx = 0; |
| 244 | add_3D_tensor_argument(idx, _input, slice); |
Michele Di Giorgio | dde9ec9 | 2018-02-13 15:24:04 +0000 | [diff] [blame] | 245 | if(!_run_in_place) |
Georgios Pinitas | 409ee0a | 2017-08-18 10:16:09 +0100 | [diff] [blame] | 246 | { |
| 247 | add_3D_tensor_argument(idx, _output, slice); |
| 248 | } |
Anthony Barbier | b6eb353 | 2018-08-08 13:20:04 +0100 | [diff] [blame] | 249 | enqueue(queue, *this, slice, lws_hint()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 250 | } |
| 251 | while(window.slide_window_slice_3D(slice)); |
| 252 | } |