| 134 | } |
| 135 | |
| 136 | Status CLConvolutionLayer::validate(const ITensorInfo *input, |
| 137 | const ITensorInfo *weights, |
| 138 | const ITensorInfo *biases, |
| 139 | const ITensorInfo *output, |
| 140 | const PadStrideInfo &conv_info, |
| 141 | const WeightsInfo &weights_info, |
| 142 | const Size2D &dilation, |
| 143 | const ActivationLayerInfo &act_info, |
| 144 | bool enable_fast_math, |
| 145 | unsigned int num_groups) |
| 146 | { |
| 147 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, weights, output); |
| 148 | ARM_COMPUTE_RETURN_ERROR_ON_DYNAMIC_SHAPE(input, weights, biases, output); |
| 149 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(!weights->are_values_constant(), "Dynamic weights are not supported"); |
| 150 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((num_groups != 1) && (input->data_layout() != DataLayout::NCHW), |
| 151 | "Grouping (num_groups != 1) with NHWC data layout is not supported"); |
| 152 | |
| 153 | const GPUTarget gpu_target = CLScheduler::get().target(); |
| 154 | const Conv2dInfo conv2d_info = Conv2dInfo(conv_info, dilation, act_info, enable_fast_math, num_groups); |
| 155 | |
| 156 | switch (opencl::ClConv2d::get_convolution_method(input, weights, output, conv2d_info, weights_info, gpu_target)) |
| 157 | { |
| 158 | case ConvolutionMethod::WINOGRAD: |
| 159 | case ConvolutionMethod::DIRECT: |
| 160 | case ConvolutionMethod::INDIRECT: |
| 161 | case ConvolutionMethod::GEMM: |
| 162 | { |
| 163 | ARM_COMPUTE_RETURN_ON_ERROR( |
| 164 | opencl::ClConv2d::validate(input, weights, biases, output, conv2d_info, weights_info)); |
| 165 | break; |
| 166 | } |
| 167 | case ConvolutionMethod::FFT: |
| 168 | { |
| 169 | // Validate FFT-based convolution layer |
| 170 | ARM_COMPUTE_RETURN_ON_ERROR(CLFFTConvolutionLayer::validate(input, weights, nullptr, output, conv_info, |
| 171 | act_info, enable_fast_math)); |
| 172 | break; |
| 173 | } |
| 174 | default: |
| 175 | ARM_COMPUTE_ERROR("Not supported."); |
| 176 | break; |
| 177 | } |
| 178 | |
| 179 | return Status{}; |
| 180 | } |
| 181 | |
| 182 | ConvolutionMethod CLConvolutionLayer::get_convolution_method(const ITensorInfo *input, |
| 183 | const ITensorInfo *weights, |
nothing calls this directly
no test coverage detected