Skip to content

Commit

Permalink
Use stream_allocator_adaptor constructor instead of factory. (#4557)
Browse files Browse the repository at this point in the history
This PR uses the `stream_allocator_adaptor` constructor instead of a factory. With CTAD, we do not need the factory and can use the constructor directly. The factory will be deprecated in rapidsai/rmm#1626.

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Mark Harris (https://github.com/harrism)

Approvers:
  - James Lamb (https://github.com/jameslamb)
  - Seunghwa Kang (https://github.com/seunghwak)

URL: #4557
  • Loading branch information
bdice authored Aug 5, 2024
1 parent 1be81a4 commit 8f86c82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cpp/src/prims/key_store.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <cuco/static_set.cuh>

#include <algorithm>
#include <cstddef>
#include <memory>
#include <optional>
#include <type_traits>
Expand Down Expand Up @@ -322,7 +323,7 @@ class key_cuco_store_t {
static_cast<size_t>(static_cast<double>(num_keys) / load_factor),
static_cast<size_t>(num_keys) + 1); // cuco::static_map requires at least one empty slot

auto stream_adapter = rmm::mr::make_stream_allocator_adaptor(
auto stream_adapter = rmm::mr::stream_allocator_adaptor(
rmm::mr::polymorphic_allocator<std::byte>(rmm::mr::get_current_device_resource()), stream);
cuco_store_ =
std::make_unique<cuco_set_type>(cuco_size,
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/prims/kv_store.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ class kv_cuco_store_t {
static_cast<size_t>(static_cast<double>(num_keys) / load_factor),
static_cast<size_t>(num_keys) + 1); // cuco::static_map requires at least one empty slot

auto stream_adapter = rmm::mr::make_stream_allocator_adaptor(
auto stream_adapter = rmm::mr::stream_allocator_adaptor(
rmm::mr::polymorphic_allocator<std::byte>(rmm::mr::get_current_device_resource()), stream);
if constexpr (std::is_arithmetic_v<value_t>) {
cuco_store_ =
Expand Down

0 comments on commit 8f86c82

Please sign in to comment.