Operates TopK operation with params.
165{
167 for (int row = 0; row < num_rows; ++row)
168 {
169 const T *values_row = data + row * row_size;
170 topc.start_collecting(values_row);
171 for (
int32 c = 0; c < row_size; ++c)
172 {
173 topc.push(c);
174 }
175
176
177 int32 *indexes_row = output_indexes + row * k;
178 T *output_row = output_values + row * k;
179
180 const auto &top_k = topc.sorted_result();
181 std::copy(top_k.begin(), top_k.end(), indexes_row);
182 std::transform(top_k.begin(), top_k.end(), output_row,
183 [values_row](
const int32 loc) { return values_row[loc]; });
184 }
185}
class to define TopK operation