stotko / stdgpu

stdgpu: Efficient STL-like Data Structures on the GPU
https://stotko.github.io/stdgpu/
Apache License 2.0
1.15k stars 81 forks source link

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

Closed tanzby closed 5 months ago

tanzby commented 5 months ago

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):

tanzby commented 5 months ago

@stotko Can you take a look? thanks!

stotko commented 5 months ago

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.