Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 1 | /* |
Matthew Bentham | 314d3e2 | 2023-06-23 10:53:52 +0000 | [diff] [blame] | 2 | * Copyright (c) 2021-2023 Arm Limited. |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +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 "src/gpu/cl/kernels/ClDirectConv3dKernel.h" |
| 25 | |
| 26 | #include "arm_compute/core/CL/ICLTensor.h" |
Matthew Bentham | 314d3e2 | 2023-06-23 10:53:52 +0000 | [diff] [blame] | 27 | #include "arm_compute/core/utils/helpers/AdjustVecSize.h" |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Giorgio Arena | 51847d5 | 2021-10-19 15:45:57 +0100 | [diff] [blame] | 29 | #include "arm_compute/core/utils/quantization/AsymmHelpers.h" |
Matthew Bentham | 314d3e2 | 2023-06-23 10:53:52 +0000 | [diff] [blame] | 30 | #include "arm_compute/core/utils/StringUtils.h" |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 31 | |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 32 | #include "src/core/CL/CLValidate.h" |
| 33 | #include "src/core/helpers/WindowHelpers.h" |
| 34 | #include "support/Cast.h" |
| 35 | |
| 36 | namespace arm_compute |
| 37 | { |
| 38 | namespace opencl |
| 39 | { |
| 40 | namespace kernels |
| 41 | { |
| 42 | namespace |
| 43 | { |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 44 | Status validate_arguments(const ITensorInfo *src0, |
| 45 | const ITensorInfo *src1, |
| 46 | const ITensorInfo *src2, |
| 47 | const ITensorInfo *dst, |
| 48 | const Conv3dInfo &conv3d_info) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 49 | { |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 50 | ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_LAYOUT(src0, src1, dst); |
| 51 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src0->data_layout() != DataLayout::NDHWC, "Only NDHWC layout supported"); |
Gunes Bayir | fdb5342 | 2022-05-25 10:09:39 +0100 | [diff] [blame] | 52 | |
| 53 | // When fusing activation, same workaround introduced for COMPMID-5324 may be necessary |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 54 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(conv3d_info.act_info.enabled(), "Fused activation not supported"); |
| 55 | |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 56 | ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(src0); |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 57 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(src0, 1, DataType::F16, DataType::F32, DataType::QASYMM8, |
| 58 | DataType::QASYMM8_SIGNED); |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 59 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src0, src1); |
Freddie Liardet | 69df64f | 2021-10-26 14:06:47 +0100 | [diff] [blame] | 60 | ARM_COMPUTE_RETURN_ERROR_ON(conv3d_info.dilation != Size3D(1U, 1U, 1U)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 61 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 62 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src1->dimension(1) != src0->dimension(0), |
| 63 | "Weights feature map dimension should match the respective src's one"); |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 64 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src1->num_dimensions() > 5, "Weights can be at most 5 dimensional"); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 65 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 66 | ARM_COMPUTE_RETURN_ERROR_ON(src1->dimension(2) > |
| 67 | (src0->dimension(1) + conv3d_info.padding.left + conv3d_info.padding.right)); |
| 68 | ARM_COMPUTE_RETURN_ERROR_ON(src1->dimension(3) > |
| 69 | (src0->dimension(2) + conv3d_info.padding.top + conv3d_info.padding.bottom)); |
| 70 | ARM_COMPUTE_RETURN_ERROR_ON(src1->dimension(4) > |
| 71 | (src0->dimension(3) + conv3d_info.padding.front + conv3d_info.padding.back)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 72 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 73 | if (src2 != nullptr) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 74 | { |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 75 | if (is_data_type_quantized(src0->data_type())) |
Giorgio Arena | 51847d5 | 2021-10-19 15:45:57 +0100 | [diff] [blame] | 76 | { |
| 77 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(src2, 1, DataType::S32); |
| 78 | } |
| 79 | else |
| 80 | { |
| 81 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src1, src2); |
| 82 | } |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 83 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src2->dimension(0) != src1->dimension(0), |
| 84 | "Biases size and number of dst feature maps should match"); |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 85 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(src2->num_dimensions() > 1, "Biases should be one dimensional"); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | // Checks performed when dst is configured |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 89 | if (dst->total_size() != 0) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 90 | { |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 91 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(dst->dimension(0) != src1->dimension(0), "Weights and dst OFMs should match"); |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 92 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS( |
| 93 | dst->tensor_shape(), |
| 94 | misc::shape_calculator::compute_conv3d_shape(src0->tensor_shape(), src1->tensor_shape(), conv3d_info)); |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 95 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src0, dst); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | return Status{}; |
| 99 | } |
| 100 | } // namespace |
| 101 | |
| 102 | ClDirectConv3dKernel::ClDirectConv3dKernel() |
| 103 | { |
| 104 | _type = CLKernelType::DIRECT; |
| 105 | } |
| 106 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 107 | void ClDirectConv3dKernel::configure(const CLCompileContext &compile_context, |
| 108 | const ITensorInfo *src0, |
| 109 | const ITensorInfo *src1, |
| 110 | const ITensorInfo *src2, |
| 111 | ITensorInfo *dst, |
| 112 | const Conv3dInfo &conv3d_info) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 113 | { |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 114 | ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 115 | |
| 116 | // Perform validation |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 117 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src0, src1, src2, dst, conv3d_info)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 118 | |
| 119 | // Create window and update padding |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 120 | const DataType data_type = src0->data_type(); |
| 121 | const size_t src_width = src0->dimension(1); |
| 122 | const size_t src_height = src0->dimension(2); |
| 123 | const size_t src_depth = src0->dimension(3); |
| 124 | const size_t src_channels = src0->dimension(0); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 125 | const size_t dst_width = dst->dimension(1); |
| 126 | const size_t dst_height = dst->dimension(2); |
| 127 | const size_t dst_depth = dst->dimension(3); |
| 128 | const size_t dst_channels = dst->dimension(0); |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 129 | const size_t weights_width = src1->dimension(2); |
| 130 | const size_t weights_height = src1->dimension(3); |
| 131 | const size_t weights_depth = src1->dimension(4); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 132 | const size_t pad_left = conv3d_info.padding.left; |
| 133 | const size_t pad_top = conv3d_info.padding.top; |
| 134 | const size_t pad_front = conv3d_info.padding.front; |
| 135 | const size_t conv_stride_x = conv3d_info.stride.x(); |
| 136 | const size_t conv_stride_y = conv3d_info.stride.y(); |
| 137 | const size_t conv_stride_z = conv3d_info.stride.z(); |
| 138 | |
| 139 | const size_t n0 = std::min(dst->dimension(0), static_cast<size_t>(4u)); |
| 140 | const size_t m0 = (dst->tensor_shape()[0] > 16) ? ((data_type == DataType::F32) ? 2U : 4U) : 1U; |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 141 | const size_t k0 = adjust_vec_size(8u, src0->dimension(0)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 142 | const size_t partial_store_n0 = dst->dimension(0) % n0; |
| 143 | |
| 144 | CLBuildOptions build_options; |
| 145 | build_options.add_option("-cl-fast-relaxed-math"); |
| 146 | build_options.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 147 | build_options.add_option("-DSRC_WIDTH=" + support::cpp11::to_string(src_width)); |
| 148 | build_options.add_option("-DSRC_HEIGHT=" + support::cpp11::to_string(src_height)); |
| 149 | build_options.add_option("-DSRC_DEPTH=" + support::cpp11::to_string(src_depth)); |
| 150 | build_options.add_option("-DSRC_CHANNELS=" + support::cpp11::to_string(src_channels)); |
| 151 | build_options.add_option("-DDST_WIDTH=" + support::cpp11::to_string(dst_width)); |
| 152 | build_options.add_option("-DDST_HEIGHT=" + support::cpp11::to_string(dst_height)); |
| 153 | build_options.add_option("-DDST_DEPTH=" + support::cpp11::to_string(dst_depth)); |
| 154 | build_options.add_option("-DDST_CHANNELS=" + support::cpp11::to_string(dst_channels)); |
| 155 | build_options.add_option("-DWEI_WIDTH=" + support::cpp11::to_string(weights_width)); |
| 156 | build_options.add_option("-DWEI_HEIGHT=" + support::cpp11::to_string(weights_height)); |
| 157 | build_options.add_option("-DWEI_DEPTH=" + support::cpp11::to_string(weights_depth)); |
| 158 | build_options.add_option("-DSTRIDE_X=" + support::cpp11::to_string(conv_stride_x)); |
| 159 | build_options.add_option("-DSTRIDE_Y=" + support::cpp11::to_string(conv_stride_y)); |
| 160 | build_options.add_option("-DSTRIDE_Z=" + support::cpp11::to_string(conv_stride_z)); |
| 161 | build_options.add_option("-DPAD_LEFT=" + support::cpp11::to_string(pad_left)); |
| 162 | build_options.add_option("-DPAD_TOP=" + support::cpp11::to_string(pad_top)); |
| 163 | build_options.add_option("-DPAD_FRONT=" + support::cpp11::to_string(pad_front)); |
| 164 | build_options.add_option("-DN0=" + support::cpp11::to_string(n0)); |
| 165 | build_options.add_option("-DM0=" + support::cpp11::to_string(m0)); |
| 166 | build_options.add_option("-DK0=" + support::cpp11::to_string(k0)); |
| 167 | build_options.add_option("-DPARTIAL_N0=" + support::cpp11::to_string(partial_store_n0)); |
Giorgio Arena | 51847d5 | 2021-10-19 15:45:57 +0100 | [diff] [blame] | 168 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 169 | if (src2 != nullptr) |
Giorgio Arena | 51847d5 | 2021-10-19 15:45:57 +0100 | [diff] [blame] | 170 | { |
| 171 | build_options.add_option(std::string("-DHAS_BIAS")); |
| 172 | build_options.add_option(std::string("-DBIA_DATA_TYPE=" + get_cl_type_from_data_type(src2->data_type()))); |
| 173 | } |
| 174 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 175 | if (is_data_type_quantized(data_type)) |
Giorgio Arena | 51847d5 | 2021-10-19 15:45:57 +0100 | [diff] [blame] | 176 | { |
| 177 | const UniformQuantizationInfo iqinfo = src0->quantization_info().uniform(); |
| 178 | const UniformQuantizationInfo wqinfo = src1->quantization_info().uniform(); |
| 179 | const UniformQuantizationInfo oqinfo = dst->quantization_info().uniform(); |
| 180 | |
| 181 | PixelValue zero_value = PixelValue(0, src0->data_type(), src0->quantization_info()); |
| 182 | int zero_value_s32; |
| 183 | zero_value.get(zero_value_s32); |
| 184 | |
| 185 | float multiplier = iqinfo.scale * wqinfo.scale / oqinfo.scale; |
| 186 | int output_multiplier = 0; |
| 187 | int output_shift = 0; |
| 188 | quantization::calculate_quantized_multiplier(multiplier, &output_multiplier, &output_shift); |
| 189 | build_options.add_option("-DIS_QUANTIZED"); |
| 190 | build_options.add_option("-DDST_MULTIPLIER=" + support::cpp11::to_string(output_multiplier)); |
| 191 | build_options.add_option("-DDST_SHIFT=" + support::cpp11::to_string(output_shift)); |
| 192 | build_options.add_option("-DSRC_OFFSET=" + support::cpp11::to_string(-iqinfo.offset)); |
| 193 | build_options.add_option("-DWEI_OFFSET=" + support::cpp11::to_string(-wqinfo.offset)); |
| 194 | build_options.add_option("-DDST_OFFSET=" + support::cpp11::to_string(oqinfo.offset)); |
| 195 | build_options.add_option("-DZERO_VALUE=" + support::cpp11::to_string(zero_value_s32)); |
| 196 | build_options.add_option("-DACC_DATA_TYPE=" + get_cl_type_from_data_type(DataType::S32)); |
| 197 | } |
| 198 | else |
| 199 | { |
| 200 | build_options.add_option("-DACC_DATA_TYPE=" + get_cl_type_from_data_type(DataType::F32)); |
| 201 | build_options.add_option("-DZERO_VALUE=" + support::cpp11::to_string(0)); |
| 202 | build_options.add_option("-DSRC_OFFSET=" + support::cpp11::to_string(0)); |
| 203 | build_options.add_option("-DWEI_OFFSET=" + support::cpp11::to_string(0)); |
| 204 | build_options.add_option("-DDST_OFFSET=" + support::cpp11::to_string(0)); |
| 205 | } |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 206 | |
| 207 | std::string kernel_name = "direct_convolution3d_ndhwc"; |
| 208 | _kernel = create_kernel(compile_context, kernel_name, build_options.options()); |
| 209 | |
| 210 | // Configure kernel window |
| 211 | Window win = calculate_max_window(*dst, Steps(n0, m0)); |
| 212 | ICLKernel::configure_internal(win); |
| 213 | |
| 214 | // Set config_id for enabling LWS tuning |
| 215 | _config_id = kernel_name; |
| 216 | _config_id += "_"; |
| 217 | _config_id += lower_string(string_from_data_type(data_type)); |
| 218 | _config_id += "_"; |
| 219 | _config_id += support::cpp11::to_string(weights_width); |
| 220 | _config_id += "_"; |
| 221 | _config_id += support::cpp11::to_string(weights_height); |
| 222 | _config_id += "_"; |
| 223 | _config_id += support::cpp11::to_string(weights_depth); |
| 224 | _config_id += "_"; |
| 225 | _config_id += support::cpp11::to_string(conv_stride_x); |
| 226 | _config_id += "_"; |
| 227 | _config_id += support::cpp11::to_string(conv_stride_y); |
| 228 | _config_id += "_"; |
| 229 | _config_id += support::cpp11::to_string(conv_stride_z); |
| 230 | _config_id += "_"; |
| 231 | _config_id += support::cpp11::to_string(dst_width); |
| 232 | _config_id += "_"; |
| 233 | _config_id += support::cpp11::to_string(dst_height); |
| 234 | _config_id += "_"; |
| 235 | _config_id += support::cpp11::to_string(dst_channels); |
| 236 | } |
| 237 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 238 | Status ClDirectConv3dKernel::validate(const ITensorInfo *src0, |
| 239 | const ITensorInfo *src1, |
| 240 | const ITensorInfo *src2, |
| 241 | const ITensorInfo *dst, |
| 242 | const Conv3dInfo &conv3d_info) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 243 | { |
Sheri Zhang | 5dda217 | 2021-10-15 19:54:17 +0100 | [diff] [blame] | 244 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(src0, src1, src2, dst, conv3d_info)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 245 | return Status{}; |
| 246 | } |
| 247 | |
| 248 | void ClDirectConv3dKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) |
| 249 | { |
| 250 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 251 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window); |
| 252 | |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 253 | const auto src = |
| 254 | utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0)); |
| 255 | const auto weights = |
| 256 | utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_1)); |
| 257 | const auto biases = |
| 258 | utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_2)); |
| 259 | auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST)); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 260 | |
| 261 | // Get initial windows |
| 262 | Window slice = window.first_slice_window_3D(); |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 263 | slice.set(Window::DimY, Window::Dimension(0, |
| 264 | ceil_to_multiple(dst->info()->dimension(1) * dst->info()->dimension(2) * |
| 265 | dst->info()->dimension(3), |
| 266 | slice.y().step()), |
| 267 | slice.y().step())); |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 268 | slice.set(Window::DimZ, Window::Dimension(0, dst->info()->dimension(4), 1)); |
| 269 | |
| 270 | unsigned int idx = 0; |
| 271 | add_4D_tensor_argument(idx, src, slice); |
| 272 | add_4D_tensor_argument(idx, dst, slice); |
| 273 | add_4D_tensor_argument(idx, weights, slice); |
Felix Thomasmathibalan | afd38f0 | 2023-09-27 17:46:17 +0100 | [diff] [blame] | 274 | if (biases != nullptr) |
Giorgio Arena | 945ae9e | 2021-10-13 11:13:04 +0100 | [diff] [blame] | 275 | { |
| 276 | add_1D_tensor_argument(idx, biases, slice); |
| 277 | } |
| 278 | enqueue(queue, *this, slice, lws_hint()); |
| 279 | } |
| 280 | } // namespace kernels |
| 281 | } // namespace opencl |
| 282 | } // namespace arm_compute |