[ENHANCEMENT]: Add hasher/comparator adaptor to better support mapping table use case
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 667
- Forks
- 120
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 4
Description
Is your feature request related to a problem? Please describe.
Many hash-based implementations rely on the mapping table method to handle large keys/values that are expensive to copy or move around. Every time users need to write the mapping table hasher/key_equal adaptors on their own, they shouldn't have to.
Describe the solution you'd like
As proposed by @esoha-nvidia, to better serve all users in this scenario, cuco could provide two handy utilities to the user:
mapping_table_hashwrapper constructed from a span (a pointer to the beginning of the original data and a size) and the original hashermapping_table_key_eqwrapper constructed from a span and the original key comparator
TODO:
- Add two utilities (probably in
include/cuco/utility/mapping_table.cuh) - Update the example accordingly
- Update godbolt link in README
Describe alternatives you've considered
Seeking help for better naming
- Is the
mapping_table_prefix descriptive enough? Any other suggestions? - STL also use
pred/predicateto refer to key comparators but I foundmapping_table_key_pred/mapping_table_predcan be misleading since we support conditional operations likeinsert_ifandcontains_ifwhere the condition is also named aspredicate mapping_table_equalgood enough?key_eqis the STL canonical but the_eqabbreviation is ambiguous.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/cuco/utility/mapping_table.cuh and compare the current mapping_table_example.cu usage. Review the naming questions alongside existing utility conventions, then update the example and the README godbolt link. Done means both adaptors are provided and all three TODO items are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100