| 320 | |
| 321 | template<typename T> |
| 322 | void update_permutation(compute::buffer_iterator<T>& keys, |
| 323 | compute::vector<int>& permutation, |
| 324 | compute::command_queue& queue) { |
| 325 | // temporary storage for keys |
| 326 | compute::vector<T> temp(permutation.size(), 0, queue); |
| 327 | |
| 328 | // permute the keys with the current reordering |
| 329 | compute::gather(permutation.begin(), permutation.end(), keys, temp.begin(), |
| 330 | queue); |
| 331 | |
| 332 | // stable_sort the permuted keys and update the permutation |
| 333 | compute::sort_by_key(temp.begin(), temp.end(), permutation.begin(), queue); |
| 334 | } |
| 335 | |
| 336 | template<typename T> |
| 337 | void apply_permutation(compute::buffer_iterator<T>& keys, |
nothing calls this directly
no test coverage detected