Sorting Algorithms with OpenCL

Hi folks, for a seminar I had the task to review different sorting algorithms on the GPU with OpenCL.
Normally, I would implement this in C++, but hey, I’ve written a wrapper for jME3, so let’s do it with jME3.

I’d like to share it with you for three reasons:

  1. To see that the OpenCL wrapper works
  2. jME is not only useful for games, you can do a lot more with it, including real science :wink:
  3. Sorting is useful in various places. For example the correct z-ordering of transparent particles.

This is the source code:

(How can I upload arbitrary files (not only images) to the forum?)
Here are the results:

Have fun with it, if you find it useful.


Oh wait its a exponential graph :slight_smile: Just thought of the cpu is really close to Quicksort on gpu :stuck_out_tongue:
Cpu would be Timsort then, wonder if that algorithm can work on gpu as well

Timsort looks like it would need a lot of synchronization because of the detection of the small runs. Heavy synchronization is the reason why Quicksort performs so badly.
But yeah, I’ve not seen any GPU-implementations of Timsort so far. @Empire_Phoenix, this would be a research topic for you, wouldn’t it? :stuck_out_tongue_winking_eye: