| 141 | } // namespace |
| 142 | |
| 143 | void CpuGemmMatrixMultiplyKernel::configure(const ITensorInfo *lhs, |
| 144 | const ITensorInfo *rhs, |
| 145 | ITensorInfo *dst, |
| 146 | float alpha, |
| 147 | bool is_interleaved, |
| 148 | const GEMMReshapeInfo &reshape_info) |
| 149 | { |
| 150 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, |
| 151 | "CpuGemmMatrixMultiplyKernel::configure"); |
| 152 | ARM_COMPUTE_ERROR_ON_NULLPTR(lhs, rhs, dst); |
| 153 | |
| 154 | // dst tensor auto inizialitation if not yet initialized |
| 155 | TensorShape tensor_shape{lhs->tensor_shape()}; |
| 156 | tensor_shape.set(0, is_interleaved ? reshape_info.n() : rhs->dimension(0)); |
| 157 | tensor_shape.set(1, is_interleaved ? reshape_info.m() : lhs->dimension(1)); |
| 158 | |
| 159 | auto_init_if_empty(*dst, lhs->clone()->set_tensor_shape(tensor_shape)); |
| 160 | |
| 161 | // Perform validate step |
| 162 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(lhs, rhs, dst, alpha, is_interleaved, reshape_info)); |
| 163 | |
| 164 | _alpha = alpha; |
| 165 | |
| 166 | // Configure kernel window |
| 167 | Window win{}; |
| 168 | |
| 169 | // Check if the dst tensor is a vector. If so,the kernel runs the vector-matrix multiplication |
| 170 | const bool is_dst_vector = (dst->dimension(1) == 1); |
| 171 | if (is_dst_vector) |
| 172 | { |
| 173 | const unsigned int num_elems_processed_per_iteration_x = (lhs->data_type() == DataType::F32) ? 16 : 32; |
| 174 | |
| 175 | win = calculate_max_window(*dst, Steps(num_elems_processed_per_iteration_x)); |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | constexpr unsigned int num_elems_processed_per_iteration_x = 8; |
| 180 | constexpr unsigned int num_elems_processed_per_iteration_y = 4; |
| 181 | |
| 182 | win = |
| 183 | calculate_max_window(*dst, Steps(num_elems_processed_per_iteration_x, num_elems_processed_per_iteration_y)); |
| 184 | } |
| 185 | |
| 186 | const auto uk = CpuGemmMatrixMultiplyKernel::get_implementation( |
| 187 | DataTypeISASelectorData{lhs->data_type(), CPUInfo::get().get_isa()}); |
| 188 | ARM_COMPUTE_ERROR_ON_NULLPTR(uk); |
| 189 | _func = uk->ukernel; |
| 190 | |
| 191 | ICPPKernel::configure(win); |
| 192 | } |
| 193 | |
| 194 | Status CpuGemmMatrixMultiplyKernel::validate(const ITensorInfo *lhs, |
| 195 | const ITensorInfo *rhs, |
nothing calls this directly
no test coverage detected