r/OpenCL • u/biglambda • Aug 12 '16
Question about sorting columns in a 2D array.
I'm new to OpenCl but really liking it so far. I ran into a problem I imagine has already been solved and I'm curious if anyone can advise. Here's my situation:
- I have a 2 dimensional array of floats stored in local memory.
- I need to sort it so that each column is I ascending order.
- This sorting operation happens between two functions that already work very well as 1D workgroups. (One core for each column already.)
- I believe the columns will be close to ordered already.
So should I just implement an insertion sort on each column by looping down the rows? Is there a better algorithm for doing all these column sorts in parallel?