Sorting for index array

I have an array of float values.
I want to sort it so that I get a new array with indices. For example:

source array => array indexes
[0.99, 0.72, 0.56, 0.88, 0.11, 0.50] => [0,3,1,2,5,4]

Perhaps there is a ready-made implementation of cuda kernel, but I have not been able to find it yet. The thrust is not suitable for me due to the fact that the data is in a batch and I cannot mix the sort results, and serial execution is a bottleneck.

cub has a segmented key-value sort
https://nvlabs.github.io/cub/struct_device_segmented_sort.html#a4093ad10868441622bae9bc7668abe2c

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.