| 133 | } // namespace |
| 134 | |
| 135 | void CpuAddMulAddKernel::configure(const ITensorInfo *input1, |
| 136 | const ITensorInfo *input2, |
| 137 | const ITensorInfo *bn_mul, |
| 138 | const ITensorInfo *bn_add, |
| 139 | ITensorInfo *add_output, |
| 140 | ITensorInfo *final_output, |
| 141 | ConvertPolicy policy, |
| 142 | const ActivationLayerInfo &act_info) |
| 143 | { |
| 144 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuAddMulAddKernel::configure"); |
| 145 | ARM_COMPUTE_UNUSED(bn_mul, bn_add, input2); |
| 146 | ARM_COMPUTE_ERROR_ON_NULLPTR(input1, input2, bn_add, bn_mul, final_output); |
| 147 | ARM_COMPUTE_ERROR_THROW_ON( |
| 148 | validate_arguments(input1, input2, bn_mul, bn_add, add_output, final_output, policy, act_info)); |
| 149 | |
| 150 | const auto uk = CpuAddMulAddKernel::get_implementation<DataTypeISASelectorData>( |
| 151 | DataTypeISASelectorData{input1->data_type(), CPUInfo::get().get_isa()}); |
| 152 | ARM_COMPUTE_ERROR_ON_NULLPTR(uk); |
| 153 | ARM_COMPUTE_ERROR_ON(uk->ukernel == nullptr); |
| 154 | |
| 155 | _policy = policy; |
| 156 | _act_info = act_info; |
| 157 | _run_method = uk->ukernel; |
| 158 | _name = std::string("CpuAddMulAddKernel/").append(uk->name); |
| 159 | |
| 160 | // Auto initialize outputs if not initialized |
| 161 | set_shape_if_empty(*final_output, input1->tensor_shape()); |
| 162 | set_data_type_if_unknown(*final_output, input1->data_type()); |
| 163 | |
| 164 | if (add_output != nullptr) |
| 165 | { |
| 166 | set_shape_if_empty(*add_output, input1->tensor_shape()); |
| 167 | set_data_type_if_unknown(*add_output, input1->data_type()); |
| 168 | } |
| 169 | |
| 170 | // Configure kernel window |
| 171 | Window win; |
| 172 | win = calculate_max_window(*final_output, Steps()); |
| 173 | ICpuKernel::configure(win); |
| 174 | } |
| 175 | |
| 176 | Status CpuAddMulAddKernel::validate(const ITensorInfo *input1, |
| 177 | const ITensorInfo *input2, |
nothing calls this directly
no test coverage detected