Search code examples
c++ccudathrust

Radix Sort vs Bitonic Sort for floats in cuda


I am trying to implement a bitonic sort as part of a closest pair d&c algorithm in cuda and I came across Thrust library. I noticed that it implements radix sort which, from what I have read, is the fastest for integers but is this the same for floats? Would it be better to implement a bitonic sort only for floats or just use the thrust version? Thanks in advance.


Solution

  • You should not write your own sorting algorithm if you're interested in speed. Sorting is an operation that has received considerable attention, and you're not likely to be able to come up with something as fast as what has been written already, regardless of whether you are using int or float.

    You should consider using an algorithm from thrust, back40computing, moderngpu, or CUB for sorting on the GPU.