O'Reilly logo

OpenCL Parallel Programming Development Cookbook by Raymond Tay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Developing bitonic sorting in OpenCL

In this section, we will walk through an implementation of sorting an arbitrary input by using the bitonic sort in OpenCL which runs better on a GPU.

We recall that bitonic sorting recursively sorts elements in the input by building up sequences and merging those into bigger sized sequences and then repeats the cycle, and the two key operations performs it really does is to conduct: a pairwise comparison to determine the greater/smaller of the two elements in a sequence, and merging the two sequences by applying the bitonic sort between them.

Getting ready

So far we have seen how we can apply the bitonic sort to bitonic sequences. The question we need to address next is what do we do with an input that is entirely ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required