-
Notifications
You must be signed in to change notification settings - Fork 105
Fix problems with heterogeneous insert input types #387
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
Conversation
include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh
Outdated
Show resolved
Hide resolved
…A#388) There are no actual code changes but moving files around.
97ee797 to
07a60be
Compare
07a60be to
b7c114e
Compare
| Value const& desired) noexcept | ||
| { | ||
| auto old = compare_and_swap(address, expected, static_cast<value_type>(desired)); | ||
| auto old = compare_and_swap(address, expected, this->native_value(desired)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
native_value is used only once. Either it's not needed or it should be applied in other places as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, but I think I will need that function for insert_or_apply soon. We can either introduce the function in this PR or the insert_or_apply PR.
|
I fucked up the merge…investigating |
PointKernel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question: when to use heterogeneous_value and when to use native_value?
include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh
Outdated
Show resolved
Hide resolved
The workflow is as follows: Take the user-provided pair-like input type and convert it to |
When dealing with hasher/comparator, can we use |
You mean using the user-provided pair-like type instead of the heterogeneous intermediate type internally and use |
So we could remove |
|
PointKernel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR fixes some of the problems with heterogeneous insert for
static_map.The input type to any of the
insert(_*)operators is nowcuco::pair<ProbeKey, mapped_type>.Also updates docs for both map and set regarding type requirements of
ProbeKey.Also adds a small convenient abstraction aka
attempt_insert_stable.