Thrust: Sortrows

Hey, can anyone demonstrate how to implement the following function in Thrust:

float *out = sortrows(float *in, int dim0, int dim1, int colnum)

which sorts the columnwise stored matrix float *in, with dim0 and dim1 vertical and horizontal dimensions respectively, on the column number colnum? I’m having real trouble working Thrust out in general, and this would be a great help to me :)