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

Method configure

src/cpu/kernels/CpuElementwiseUnaryKernel.cpp:187–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185} // namespace
186
187void 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
215Status CpuElementwiseUnaryKernel::validate(ElementWiseUnary op, const ITensorInfo &src, const ITensorInfo &dst)
216{

Callers

nothing calls this directly

Calls 8

auto_init_if_emptyFunction · 0.85
get_isaMethod · 0.80
appendMethod · 0.80
validateFunction · 0.50
get_implementationFunction · 0.50
data_typeMethod · 0.45
is_dynamicMethod · 0.45

Tested by

no test coverage detected