Skip to content

how to print keys and values of static_map , can not find accessed function to do it ? #372

Answered by sleeepyjack
bug-code asked this question in Q&A
Discussion options

You must be logged in to vote

Here you go: https://godbolt.org/z/Kvn9hPcPo

I just altered the examples/static_map/host_bulk_example.cu to do what you want to achieve.

I'm assuming performance/memory footprint isn't of concern, as printing out the actual key/value pairs is mostly used for debugging purposes. Thus, we can just compact all the key/value pairs stored in the map into a new vector.
Also, I'm assuming you're using the cuco::static_map and not the new cuco::experimental::static_map? There's only a slight API difference between the two.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bug-code
Comment options

Answer selected by bug-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants