I need an algorithm to find unique members of an array on the gpu......

For instance, if the array is something like..

2 3 4 3 5 2 2 7 5

I want the result to be..

23457.

Im not sure thats what this algorithm is called, but what will be the best way to go about this in opencl??

Thank you..

Debdatta Basu.

Hi,

I am not sure whether it's the most efficient solution.But here it is:

First use a parallel sorting algorithm(e.g Radix Sort) to sort the array.

After that lauch an openCL Kernel having dimension that of the array.Each thread needs to check 3 elements(except corner threads) :first with index same as the thread and the others just behind and ahead of this element.If any two/three of these elements are identical that element can be discarded.If all the three consecutive elements are different then the middle one is definitely unique.

Thanks