How to traverse all values for given key in kernel function of static_multimap? #783
-
|
Hi, I want to traverse all values for given key in each thread. And I'm not sure how to use static_multimap to implement it. } |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The easiest way is to use the device cuCollections/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh Lines 1482 to 1537 in 420d502 https://godbolt.org/z/oYrKacTdd demonstrates inserting the same key
By default, cuCollections/include/cuco/static_multimap.cuh Lines 96 to 97 in 420d502 Unlike linear probing, values associated with the same key are not stored in contiguous memory. Therefore, it++ will not work unless you are using linear probing with a cooperative group (CG) size of 1.
|
Beta Was this translation helpful? Give feedback.
As I mentioned above, the CG size controls how many threads are used simultaneously to query a given key. We use a default CG size of 8 for the multimap based on empirical results, with the goal of improving performance.
If you want each thread to handle a single query key independently, you can set the CG size to 1. However, this will result in reduced runtime performance.