MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / configure

Method configure

src/cpu/kernels/CpuAddKernel.cpp:167–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165} // namespace
166
167void CpuAddKernel::configure(const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, ConvertPolicy policy)
168{
169 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuAddKernel::configure");
170 ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst);
171 ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(*src0, *src1, *dst, policy));
172
173 const auto can_use_fixedpoint = add_q8_neon_fixedpoint_possible(src0, src1, dst);
174#ifdef ARM_COMPUTE_ENABLE_SME2
175 const auto can_use_sme2_impl = add_q8_sme2_fixedpoint_possible(src0, src1, dst);
176#else /* ARM_COMPUTE_ENABLE_SME2 */
177 const auto can_use_sme2_impl = false;
178#endif /* ARM_COMPUTE_ENABLE_SME2 */
179 const auto uk =
180 CpuAddKernel::get_implementation<CpuAddKernelDataTypeISASelectorData>(CpuAddKernelDataTypeISASelectorData{
181 src0->data_type(), CPUInfo::get().get_isa(), can_use_fixedpoint, can_use_sme2_impl});
182
183 ARM_COMPUTE_ERROR_ON_NULLPTR(uk);
184
185 _policy = policy;
186 _run_method = uk->ukernel;
187 _name = std::string("CpuAddKernel").append("/").append(uk->name);
188
189 // Auto initialize dst if not initialized
190 const TensorShape &out_shape = TensorShape::broadcast_shape(src0->tensor_shape(), src1->tensor_shape());
191 set_shape_if_empty(*dst, out_shape);
192 set_data_type_if_unknown(*dst, src0->data_type());
193
194 // Configure kernel window
195 Window win;
196 std::tie(win, _split_dimension) = calculate_squashed_or_max_window(*src0, *src1);
197
198 ICpuKernel::configure(win);
199}
200
201Status
202CpuAddKernel::validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, ConvertPolicy policy)

Callers

nothing calls this directly

Calls 9

set_shape_if_emptyFunction · 0.85
set_data_type_if_unknownFunction · 0.85
get_isaMethod · 0.80
appendMethod · 0.80
validate_argumentsFunction · 0.70
data_typeMethod · 0.45

Tested by

no test coverage detected