-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow iterators in cub::DeviceRadixSort #868
Comments
Have you tried the thrust::sort functions?, they allow to do what you are asking for. For example: |
@RaulPPelaez Yes I am aware of |
I agree that this should be done if possible and can look into prioritizing this after I finish updating our benchmarking infrastructure. Pinging @dumerrill and @canonizer since they know the radix sorting code best -- are ya'll aware of any reasons that this wouldn't work? Other device algorithms support iterators, so I'm curious if there's a reason |
The main difference being that Two options to implement this:
|
Thanks -- that's a good point. The double buffer approach has some other issues, too -- the current implementation casts away the const-ness of the input and then writes to the const input memory as part of the double buffering. We should fix that when addressing this issue, since the fix would reuse the same code path. |
I am working on this in NVIDIA/cub#374 |
Currently,
cub::DeviceRadixSort
only support operating on pointersIt would be good if the
d_values_in
could be an iterator.One use case is pytorch/pytorch#53841, in this PR, we are working on a sorting problem where the input keys are random numbers, and input values are 0, 1, 2, 3, ..., N. Currently, we have to generate a memory buffer to store these 0, 1, 2, ..., N, which is not optimal. It would be nice if we can do something like:
The text was updated successfully, but these errors were encountered: