[ENHANCEMENT]: Add hasher/comparator adaptor to better support mapping table use case #476
Labels
good first issue
Good for newcomers
P2: Nice to have
Desired, but not necessary
type: improvement
Improvement / enhancement to an existing function
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_hash
wrapper constructed from a span (a pointer to the beginning of the original data and a size) and the original hashermapping_table_key_eq
wrapper constructed from a span and the original key comparatorTODO:
include/cuco/utility/mapping_table.cuh
)Describe alternatives you've considered
Seeking help for better naming
mapping_table_
prefix descriptive enough? Any other suggestions?pred
/predicate
to refer to key comparators but I foundmapping_table_key_pred
/mapping_table_pred
can be misleading since we support conditional operations likeinsert_if
andcontains_if
where the condition is also named aspredicate
mapping_table_equal
good enough?key_eq
is the STL canonical but the_eq
abbreviation is ambiguous.The text was updated successfully, but these errors were encountered: