| 185 | } // namespace |
| 186 | |
| 187 | void CpuElementwiseUnaryKernel::configure(ElementWiseUnary op, const ITensorInfo &src, ITensorInfo &dst) |
| 188 | { |
| 189 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuElementwiseUnaryKernel::configure"); |
| 190 | ARM_COMPUTE_ERROR_THROW_ON(validate(op, src, dst)); |
| 191 | const auto uk = CpuElementwiseUnaryKernel::get_implementation( |
| 192 | DataTypeISASelectorData{src.data_type(), CPUInfo::get().get_isa()}); |
| 193 | ARM_COMPUTE_ERROR_ON(uk == nullptr || uk->ukernel == nullptr); |
| 194 | |
| 195 | _op = op; |
| 196 | _run_method = uk->ukernel; |
| 197 | _name = std::string("CpuElementwiseUnaryKernel").append("/").append(uk->name); |
| 198 | |
| 199 | if (uk->prepare_func != nullptr) |
| 200 | { |
| 201 | _lut = uk->prepare_func(op, &src, &dst); |
| 202 | } |
| 203 | |
| 204 | // If input shape is dynamic, expect a configured window and dst at run-time. |
| 205 | if (src.is_dynamic()) |
| 206 | { |
| 207 | return; |
| 208 | } |
| 209 | |
| 210 | auto shape_and_window = compute_output_shape_and_window(src.tensor_shape()); |
| 211 | auto_init_if_empty(dst, shape_and_window.first, 1, src.data_type()); |
| 212 | ICpuKernel::configure(shape_and_window.second); |
| 213 | } |
| 214 | |
| 215 | Status CpuElementwiseUnaryKernel::validate(ElementWiseUnary op, const ITensorInfo &src, const ITensorInfo &dst) |
| 216 | { |
nothing calls this directly
no test coverage detected