| 695 | } |
| 696 | |
| 697 | Status CpuGemmConv2d::validate(const ITensorInfo *src, |
| 698 | const ITensorInfo *weights, |
| 699 | const ITensorInfo *biases, |
| 700 | const ITensorInfo *dst, |
| 701 | const PadStrideInfo &conv_info, |
| 702 | const WeightsInfo &weights_info, |
| 703 | const Size2D &dilation, |
| 704 | const ActivationLayerInfo &act_info, |
| 705 | bool enable_fast_math, |
| 706 | unsigned int num_groups) |
| 707 | { |
| 708 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuGemmConv2d::validate"); |
| 709 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, weights, dst); |
| 710 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(weights_info.are_reshaped(), "Weights already reshaped are not supported!"); |
| 711 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(src, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, |
| 712 | DataType::BFLOAT16, DataType::F16, DataType::F32); |
| 713 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(weights, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, |
| 714 | DataType::QSYMM8_PER_CHANNEL, DataType::BFLOAT16, |
| 715 | DataType::F16, DataType::F32); |
| 716 | |
| 717 | if (!is_fixed_format(weights_info.weight_format())) |
| 718 | { |
| 719 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(src, weights); |
| 720 | } |
| 721 | |
| 722 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(num_groups > 1, "Grouping (num_groups != 1) is not supported"); |
| 723 | |
| 724 | const DataLayout data_layout = src->data_layout(); |
| 725 | const DataType data_type = src->data_type(); |
| 726 | const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 727 | const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 728 | const int idx_channel = get_data_layout_dimension_index(data_layout, DataLayoutDimension::CHANNEL); |
| 729 | const int idx_kernels = get_data_layout_dimension_index(data_layout, DataLayoutDimension::BATCHES); |
| 730 | |
| 731 | const unsigned int kernel_width = weights->dimension(idx_width); |
| 732 | const unsigned int kernel_height = weights->dimension(idx_height); |
| 733 | |
| 734 | TensorInfo im2col_reshaped_info{}; |
| 735 | TensorInfo info_gemm{}; |
| 736 | TensorInfo tmp_info{}; |
| 737 | TensorInfo weights_reshaped_info{}; |
| 738 | const ITensorInfo *gemm_input_to_use = src; |
| 739 | const ITensorInfo *gemm_output_to_use = dst; |
| 740 | const ITensorInfo *weights_to_use = weights; |
| 741 | |
| 742 | const bool append_bias = false; |
| 743 | const bool is_quantized = is_data_type_quantized_asymmetric(data_type); |
| 744 | const bool is_bf16 = data_type == DataType::BFLOAT16; |
| 745 | |
| 746 | // Get convolved dimensions |
| 747 | unsigned int conv_w = 0; |
| 748 | unsigned int conv_h = 0; |
| 749 | |
| 750 | std::tie(conv_w, conv_h) = scaled_dimensions(src->dimension(idx_width), src->dimension(idx_height), kernel_width, |
| 751 | kernel_height, conv_info, dilation); |
| 752 | |
| 753 | // Check if GEMM3D is supported |
| 754 | const CpuGemmConv2d::SkipInfo skip_info = |
nothing calls this directly
no test coverage detected