CPU sort algorithm

CPU sort algorithm

Hi,I'm currently working on the CLPP library (http://code.google.com/p/clpp/) and mainly on the CPU implementation of the 'sort' algorithm.I currently have a 'special' sort algorithm for the CPU only but after launching the benchmark I havesee that the std::sort algorithm is faster than the OpenCL one.So, it simply mean that it remain some work to have a really fast sort on the CPU. I would like to know if the Intel Engineers has some councils to give, some papers to reference etc...An important part would be use this algorithm on the Sandy Bridge too !ThanksKrys

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


Which sorting algorithm do you use? There's a lot of literature abouve parallel sorting algorithms and their relative merits.

for SIMD machines (like CPUs) BitonicSort is typically used. Try one from Intel OCL SDK, there is a dedicated sample there.

Also from the general point, the specific sorting algo to select should match the task, e.g. BubbleSort is fastest approachif the input sequence is almost sorted, demostrating O(N). While the same BubbleSort is the sloweset with O(N*N), when the input sequence is simply inversed.

From this side the Bitonic exhibits the same garaunteed complexity of n*log(n) and fits most tasks.

Leave a Comment

Please sign in to add a comment. Not a member? Join today