| 135 | } |
| 136 | |
| 137 | void ClIndirectConv2dKernel::configure(const CLCompileContext &compile_context, |
| 138 | ITensorInfo *src, |
| 139 | ITensorInfo *weights, |
| 140 | ITensorInfo *biases, |
| 141 | ITensorInfo *indirect_buffer, |
| 142 | ITensorInfo *dst, |
| 143 | const PadStrideInfo &conv_info, |
| 144 | const ActivationLayerInfo &act_info, |
| 145 | const DirectConvComputeKernelInfo &desc) |
| 146 | { |
| 147 | ARM_COMPUTE_ERROR_ON_NULLPTR(src, weights, indirect_buffer, dst); |
| 148 | |
| 149 | // Perform validation |
| 150 | ARM_COMPUTE_ERROR_THROW_ON( |
| 151 | validate_arguments(src, weights, biases, indirect_buffer, dst, conv_info, act_info, desc)); |
| 152 | |
| 153 | constexpr unsigned int channel_idx = 0; |
| 154 | constexpr unsigned int width_idx = 1; |
| 155 | constexpr unsigned int height_idx = 2; |
| 156 | const unsigned int kernel_width = weights->dimension(width_idx); |
| 157 | const unsigned int kernel_height = weights->dimension(height_idx); |
| 158 | const DataType data_type = src->data_type(); |
| 159 | |
| 160 | const GPUTarget gpu_target = get_target(); |
| 161 | |
| 162 | // Get dst shape |
| 163 | TensorShape output_shape = misc::shape_calculator::compute_deep_convolution_shape(*src, *weights, conv_info); |
| 164 | |
| 165 | // Output auto inizialitation if not yet initialized |
| 166 | auto_init_if_empty(*dst, output_shape, 1, src->data_type(), src->quantization_info()); |
| 167 | |
| 168 | // Configure kernel window |
| 169 | Window win; |
| 170 | output_shape.collapse(2U, 1U); |
| 171 | const unsigned int n0 = adjust_vec_size(desc.n0, output_shape[0]); |
| 172 | const unsigned int m0 = adjust_vec_size(desc.m0, output_shape[1]); |
| 173 | const unsigned int k0 = adjust_vec_size(desc.k0, src->dimension(channel_idx)); |
| 174 | |
| 175 | const unsigned int partial_store_n0 = dst->dimension(channel_idx) % n0; |
| 176 | |
| 177 | // Create window and update padding |
| 178 | win = calculate_max_window(output_shape, Steps(n0, m0)); |
| 179 | |
| 180 | ICLKernel::configure_internal(win); |
| 181 | |
| 182 | std::stringstream kernel_name; |
| 183 | CLBuildOptions build_options; |
| 184 | |
| 185 | kernel_name << "indirect_convolution_nhwc"; |
| 186 | |
| 187 | _export_to_cl_image = desc.export_weights_to_cl_image; |
| 188 | |
| 189 | // Update the padding for the weights tensor if we can export to cl_image |
| 190 | if (_export_to_cl_image) |
| 191 | { |
| 192 | gemm::update_padding_for_cl_image(weights); |
| 193 | } |
| 194 |
nothing calls this directly
no test coverage detected