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

Method configure

src/cpu/kernels/CpuTopKVKernel.cpp:143–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141} // namespace
142
143void CpuTopKVKernel::configure(const ITensorInfo *predictions, const ITensorInfo *targets, ITensorInfo *dst, uint32_t k)
144{
145 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuTopKVKernel::configure");
146 ARM_COMPUTE_UNUSED(targets); // workaround for a compiler bug about a false positive -Wunused-parameter
147 ARM_COMPUTE_ERROR_ON_NULLPTR(predictions, targets, dst);
148 ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(*predictions, *targets, *dst, k));
149
150 const auto uk = CpuTopKVKernel::get_implementation<CpuTopKVKernelDataTypeISASelectorData>(
151 CpuTopKVKernelDataTypeISASelectorData{predictions->data_type(), CPUInfo::get().get_isa()});
152
153 ARM_COMPUTE_ERROR_ON_NULLPTR(uk);
154
155 _run_method = uk->ukernel;
156 _name = std::string("CpuTopKVKernel").append("/").append(uk->name);
157 _k = k;
158 // Auto initialize dst if not initialized
159 auto_init_if_empty(*dst, TensorShape(predictions->dimension(1)), 1U, DataType::U8);
160 // Configure kernel window
161 Window win = calculate_max_window(*dst, Steps());
162 ICpuKernel::configure(win);
163}
164size_t CpuTopKVKernel::get_mws(const CPUInfo &platform, size_t thread_count) const
165{
166 ARM_COMPUTE_UNUSED(thread_count);

Callers

nothing calls this directly

Calls 9

auto_init_if_emptyFunction · 0.85
StepsClass · 0.85
get_isaMethod · 0.80
appendMethod · 0.80
validate_argumentsFunction · 0.70
TensorShapeClass · 0.50
calculate_max_windowFunction · 0.50
data_typeMethod · 0.45
dimensionMethod · 0.45

Tested by

no test coverage detected