Skip to content

Why do payload types need to be bitwise comparable in static_map? #426

Closed Answered by sleeepyjack
kevkrist asked this question in Q&A
Discussion options

You must be logged in to vote

We internally dispatch different insertion strategies depending on the key/value types and GPU architecture to achieve best performance. If sizeof(Key)+sizeof(Payload) <= 8, we can swap the entire pair into a slot with a single "packed" CAS operation. If the combined size exceeds the GPUs native CAS size, we swap the key and the payload in separately. This is done by either a back-to-back CAS strategy or a CAS operation on the key followed by a dependent relaxed write operation on the payload.

To answer your question regarding cuco::is_bitwise_comparable_v(T): The most restrictive strategy (and the fastest one too) here is the packed CAS approach, which requires both keys and payloads to …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@kevkrist
Comment options

@sleeepyjack
Comment options

Answer selected by kevkrist
@sleeepyjack
Comment options

@kevkrist
Comment options

@jrhemstad
Comment options

@kevkrist
Comment options

Comment options

You must be logged in to vote
1 reply
@sleeepyjack
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants