Sorting for doubles

Hello! My sorting of doubles in CUDA works rather slow and I found links to bitonic and thrust, but the first is not for doubles and the second should be called from host while my array is on the device. Array is ~2000 elements. Does somebody know a way to speed up sorting? Any hint is appreciated.


Thrust works with both host and device arrays. You just have to wrap the raw pointer in this case.

thrust::device_ptr<double> dev_ptr(array_ptr);

thrust::sort(dev_ptr, dev_ptr + n);

Thanks a lot, thrust is much faster!