MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / update_permutation

Function update_permutation

src/backend/opencl/kernel/sift.hpp:322–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321template<typename T>
322void 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
336template<typename T>
337void apply_permutation(compute::buffer_iterator<T>& keys,

Callers

nothing calls this directly

Calls 1

sort_by_keyFunction · 0.50

Tested by

no test coverage detected