diff --git a/design.md b/design.md new file mode 100644 index 000000000..29fc2fa83 --- /dev/null +++ b/design.md @@ -0,0 +1,15 @@ +There are several “hash map” like data structures lie on a spectrum from high-performance, bare metal with restricted features to more convenient, +full-featured structures that may be less performant. +cuCollections will likely have several classes that are on different points on this spectrum. + + +| Tentative Name | Summary | Priority | Est. Release | Size | Supported Key Types | Supported Value Types | Duplicate Keys? | Sentinel Values? | Insert | Find | Concurrent
Insert/Find? | Erase | Concurrent
Insert/Find/Erase? | Bulk Insert | Bulk Find | +|:--------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------:|:------------:|:--------:|:-------------------:|:---------------------:|:---------------:|:----------------:|:------:|:----:|:---------------------------:|:-----------------------------------:|:---------------------------------:|:-----------:|:---------:| +| `static_map` | A fixed-size, open addressing hash map using linear probing.
Requires reserving sentinel key/values for empty slots.
Supports insert/find (not concurrent). Does not support erase. | P0 | Aug 2020 | Static | Arithmetic | Trivially Copyable | No | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes | +| `chained_map` | A hash map that can grow by chaining together multiple `static_map`
submaps. Requires reserving sentinel key/values for empty slots.
Growth happens automatically in bulk insert operations, or
can be done manually by user. | P0 | Aug 2020 | Dynamic | Arithmetic | Trivially Copyable | No | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes | +| `static_multimap` | A fixed-size, open addressing hash multimap using linear probing.
Supports insert/find (not concurrent). Does not support erase.
Requires reserving sentinel key/values for empty slots. | P1 | ? | Static | Arithmetic | Trivially Copyable | Yes | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes | +| `chained_multimap` | A hash multimap that can grow by chaining together multiple `static_multimap`
submaps. Growth happens automatically in bulk insert operations, or
can be done manually by user. Requires reserving sentinel key/values for empty slots. | P1 | ? | Dynamic | Arithmetic | Trivially Copyable | Yes | Yes. Key & Value | Yes | Yes | No | No | N/A | Yes | Yes | +| `general_static_map` | A fixed-size, open addressing hash map using linear probing.
Uses an additional array of status bits instead of sentinels for empty slots.
Tentatively supports concurrent insert/find/erase. | P2 | ? | Static | Trivially Copyable? | Trivially Copyable? | No | No | Yes | Yes | Yes | Yes, but slot
cannot be reused. | Yes | Yes | Yes | +| `general_chained_map` | A hash map that can grow by chaining together multiple `general_static_map`
submaps. Growth happens automatically in bulk insert operations, or
can be done manually by user. Uses status bits instead of sentinel values. | P2 | ? | Dynamic | Trivially Copyable? | Trivially Copyable? | No | No | Yes | Yes | Yes | Yes, but slot
cannot be reused. | Yes | Yes | Yes | +| `general_static_multimap` | A fixed-size, open addressing hash multimap using linear probing.
Uses an additional array of status bits instead of sentinels for empty slots.
Tentatively supports concurrent insert/find/erase. | P2 | ? | Static | Trivially Copyable? | Trivially Copyable? | Yes | No | Yes | Yes | Yes | Yes, but slot
cannot be reused. | Yes | Yes | Yes | +| `general_chained_multimap` | A hash multimap that can grow by chaining together multiple `general_static_multimap`
submaps. Growth happens automatically in bulk insert operations, or
can be done manually by user. Uses status bits instead of sentinel values. | P2 | ? | Dynamic | Trivially Copyable? | Trivially Copyable? | Yes | No | Yes | Yes | Yes | Yes, but slot
cannot be reused. | Yes | Yes | Yes |