| 132 | } |
| 133 | |
| 134 | Status ClConv2d::validate(const ITensorInfo *src, |
| 135 | const ITensorInfo *weights, |
| 136 | const ITensorInfo *biases, |
| 137 | const ITensorInfo *dst, |
| 138 | const Conv2dInfo &conv2d_info, |
| 139 | const WeightsInfo &weights_info) |
| 140 | { |
| 141 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, weights, dst); |
| 142 | ARM_COMPUTE_RETURN_ERROR_ON_MSG((conv2d_info.num_groups != 1) && (src->data_layout() != DataLayout::NCHW), |
| 143 | "Grouping (num_groups != 1) with NHWC data layout is not supported"); |
| 144 | |
| 145 | const GPUTarget gpu_target = CLScheduler::get().target(); |
| 146 | |
| 147 | switch (ClConv2d::get_convolution_method(src, weights, dst, conv2d_info, weights_info, gpu_target)) |
| 148 | { |
| 149 | case ConvolutionMethod::WINOGRAD: |
| 150 | { |
| 151 | //Validate Winograd |
| 152 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(conv2d_info.num_groups != 1, |
| 153 | "Grouping (num_groups != 1) with ClWinogradConv2d is not supported"); |
| 154 | ARM_COMPUTE_RETURN_ON_ERROR(ClWinogradConv2d::validate(src, weights, biases, dst, conv2d_info.conv_info, |
| 155 | conv2d_info.act_info, conv2d_info.enable_fast_math)); |
| 156 | break; |
| 157 | } |
| 158 | case ConvolutionMethod::DIRECT: |
| 159 | { |
| 160 | // Validate direct convolution layer |
| 161 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(conv2d_info.num_groups != 1, |
| 162 | "Grouping (num_groups != 1) with ClDirectConv2d is not supported"); |
| 163 | ARM_COMPUTE_RETURN_ON_ERROR( |
| 164 | ClDirectConv2d::validate(src, weights, biases, dst, conv2d_info.conv_info, conv2d_info.act_info)); |
| 165 | break; |
| 166 | } |
| 167 | case ConvolutionMethod::INDIRECT: |
| 168 | { |
| 169 | // Validate indirect convolution layer |
| 170 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(conv2d_info.num_groups != 1, |
| 171 | "Grouping (num_groups != 1) with ClIndirectConv2d is not supported"); |
| 172 | ARM_COMPUTE_RETURN_ON_ERROR( |
| 173 | ClIndirectConv2d::validate(src, weights, biases, dst, conv2d_info.conv_info, conv2d_info.act_info)); |
| 174 | break; |
| 175 | } |
| 176 | case ConvolutionMethod::GEMM: |
| 177 | { |
| 178 | // Validate gemm-based convolution layer |
| 179 | ARM_COMPUTE_RETURN_ON_ERROR(ClGemmConv2d::validate(src, weights, biases, dst, conv2d_info, weights_info)); |
| 180 | break; |
| 181 | } |
| 182 | default: |
| 183 | ARM_COMPUTE_ERROR("Not supported."); |
| 184 | break; |
| 185 | } |
| 186 | |
| 187 | return Status{}; |
| 188 | } |
| 189 | |
| 190 | ConvolutionMethod ClConv2d::get_convolution_method(const ITensorInfo *src, |
| 191 | const ITensorInfo *weights, |
nothing calls this directly
no test coverage detected