Rank of each element in a matrix row using CUDA or pyCUDA

  1. How to find the rank of each element in a matrix row using CUDA? As I am using argsort() to do the same in python, Is there any equivalent function to do the same? I did not find any function for this task.

For example:

Row elements = [4,1,7,1]
ranks = [1,0,2,0]

Same rank will be assigned to equal values.

cross posting:

http://stackoverflow.com/questions/41973178/rank-of-each-element-in-a-matrix-row-using-cuda