Sorting and scan a large number of arrays of varying sizes #1587
Unanswered
wanghongyu2001
asked this question in
CUB
Replies: 1 comment 9 replies
-
Thank you for reaching out with your question, @wanghongyu2001.
If your arrays reside at different offsets within the same memory allocation, you can use cub::DeviceSegmentedSort. Here's an godbolt example that you can play around with. Usage example
Output:
Since you also asked about prefix sum, could you elaborate what your to-be-prefix-summed input looks like? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use the CUB library for sorting, with different blocks handling arrays of different sizes. However, I need to specify the parameters of
cub::BlockRadixSort
at compile time. But I can only determine the sizes of these arrays at runtime, as each block handles arrays of different sizes. So, it seems that I cannot use CUB in this case. Is there any solution? Or should I use batch Thrust sort instead?For example, if I need to sort and compute prefix sums for hundreds of thousands of arrays, with sizes ranging from 0 to several hundred thousand, is there any way to efficiently perform these operations on the GPU using the CUB library?
Any suggestions are helpful.
Beta Was this translation helpful? Give feedback.
All reactions