Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Similar to how [Thrust](https://github.com/thrust/thrust) and [CUB](https://gith

### Major Updates

__02/03/2026__ Modernized `dynamic_map`: promoted `cuco::experimental::dynamic_map` to `cuco::dynamic_map` and removed the legacy implementation

__01/30/2026__ Removed legacy `static_multimap` implementation and promoted `cuco::experimental::static_multimap` to `cuco::static_multimap`

__10/08/2025__ Changed `cuda_allocator` to stream-ordered, requiring `cuda::stream_ref` parameter in `allocate`/`deallocate`.
Expand Down Expand Up @@ -244,7 +246,7 @@ We plan to add many GPU-accelerated, concurrent data structures to `cuCollection

### `dynamic_map`

`cuco::dynamic_map` links together multiple `cuco::static_map`s to provide a hash table that can grow as key-value pairs are inserted. It currently only provides host-bulk APIs. See the Doxygen documentation in `dynamic_map.cuh` for more detailed information.
`cuco::dynamic_map` links together multiple `cuco::static_map`s to provide a hash table that can grow as key-value pairs are inserted. It supports `insert`, `insert_or_assign`, `erase`, `find`, `contains`, and `retrieve_all` operations via host-bulk APIs with kernel-based implementations for optimal performance. See the Doxygen documentation in `dynamic_map.cuh` for more detailed information.

#### Examples:
- [Host-bulk APIs (TODO)]()
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/dynamic_map/contains_bench.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,7 +62,7 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_contains(
state.add_element_count(num_keys);

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
map.contains(keys.begin(), keys.end(), result.begin(), {}, {}, launch.get_stream());
map.contains(keys.begin(), keys.end(), result.begin(), {launch.get_stream()});
});
}

Expand Down
7 changes: 3 additions & 4 deletions benchmarks/dynamic_map/erase_bench.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,15 +56,14 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_erase(

state.exec(nvbench::exec_tag::sync | nvbench::exec_tag::timer,
[&](nvbench::launch& launch, auto& timer) {
// dynamic map with erase support
cuco::dynamic_map<Key, Value> map{static_cast<size_t>(initial_size),
cuco::empty_key<Key>{-1},
cuco::empty_value<Value>{-1},
cuco::erased_key<Key>{-2}};
map.insert(pairs.begin(), pairs.end(), {}, {}, launch.get_stream());
map.insert(pairs.begin(), pairs.end(), {launch.get_stream()});

timer.start();
map.erase(keys.begin(), keys.end(), {}, {}, launch.get_stream());
map.erase(keys.begin(), keys.end(), {launch.get_stream()});
timer.stop();
});
}
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/dynamic_map/find_bench.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,7 +62,7 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_find(
state.add_element_count(num_keys);

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
map.find(keys.begin(), keys.end(), result.begin(), {}, {}, launch.get_stream());
map.find(keys.begin(), keys.end(), result.begin(), {launch.get_stream()});
});
}

Expand Down
11 changes: 4 additions & 7 deletions benchmarks/dynamic_map/insert_bench.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,15 +57,12 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_insert(

state.exec(
nvbench::exec_tag::sync | nvbench::exec_tag::timer, [&](nvbench::launch& launch, auto& timer) {
cuco::dynamic_map<Key, Value> map{static_cast<size_t>(initial_size),
cuco::empty_key<Key>{-1},
cuco::empty_value<Value>{-1},
{},
launch.get_stream()};
cuco::dynamic_map<Key, Value> map{
static_cast<size_t>(initial_size), cuco::empty_key<Key>{-1}, cuco::empty_value<Value>{-1}};

timer.start();
for (int64_t i = 0; i < num_keys; i += batch_size) {
map.insert(pairs.begin() + i, pairs.begin() + i + batch_size, {}, {}, launch.get_stream());
map.insert(pairs.begin() + i, pairs.begin() + i + batch_size, {launch.get_stream()});
}
timer.stop();
});
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/dynamic_map/retrieve_all_bench.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025, NVIDIA CORPORATION.
* Copyright (c) 2025-2026, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,14 +53,14 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_retrieve_all(
cuco::dynamic_map<Key, Value> map{
static_cast<size_t>(initial_size), cuco::empty_key<Key>{-1}, cuco::empty_value<Value>{-1}};
map.insert(pairs.begin(), pairs.end());
// Prepare output buffers
thrust::device_vector<Key> retrieved_keys(map.get_size());
thrust::device_vector<Value> retrieved_values(map.get_size());

state.add_element_count(map.get_size());
thrust::device_vector<Key> retrieved_keys(map.size());
thrust::device_vector<Value> retrieved_values(map.size());

state.add_element_count(map.size());

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
map.retrieve_all(retrieved_keys.begin(), retrieved_values.begin(), launch.get_stream());
map.retrieve_all(retrieved_keys.begin(), retrieved_values.begin(), {launch.get_stream()});
});
}

Expand Down
Loading
Loading