| 141 | } // namespace |
| 142 | |
| 143 | void 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 | } |
| 164 | size_t CpuTopKVKernel::get_mws(const CPUInfo &platform, size_t thread_count) const |
| 165 | { |
| 166 | ARM_COMPUTE_UNUSED(thread_count); |
nothing calls this directly
no test coverage detected