Skip to content
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

Unexpected insertion when using unordered_map and capacity equals to 4 #411

Closed
tanzby opened this issue Apr 7, 2024 · 2 comments · Fixed by #414
Closed

Unexpected insertion when using unordered_map and capacity equals to 4 #411

tanzby opened this issue Apr 7, 2024 · 2 comments · Fixed by #414
Labels

Comments

@tanzby
Copy link
Contributor

tanzby commented Apr 7, 2024

Describe the bug
The insertion of unordered_map does not work correctly under capacity=4.

Steps to reproduce
Change the n from 100 to 4 in examples/cuda/unordered_map.cu, compile and run this example code.

Expected behavior
the terminal should be:
The duplicate-free map of numbers contains 5 elements (5 expected) and the computed sums are (2, 4) ((10, 30) expected)

Actual behavior
the terminal actually shows:
The duplicate-free map of numbers contains 2 elements (5 expected) and the computed sums are (2, 4) ((10, 30) expected)

System (please complete the following information):

  • OS: Ubuntu 20.04
  • Compiler: GCC
  • Backend: CUDA
  • Library version: master
@tanzby tanzby added the bug label Apr 7, 2024
@tanzby tanzby changed the title Unexpected insertion when using unordered_map Unexpected insertion when using unordered_map and capacity equals to 4 Apr 7, 2024
@tanzby
Copy link
Contributor Author

tanzby commented Apr 8, 2024

@stotko Can you take a look? thanks!

@stotko
Copy link
Owner

stotko commented Apr 8, 2024

Thanks for the report! This is indeed an issue for very low capacity sizes as the internal excess list is too small in this case. #414 fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants