Skip to content

Commit c354e6c

Browse files
bdiceenp1s0
authored andcommitted
Use pinned_host_memory_resource instead of pinned_memory_resource. (rapidsai#1434)
We want to remove RMM's `pinned_memory_resource` in favor of `pinned_host_memory_resource`, because the latter aligns with CCCL's MR design that we will be adopting throughout RAPIDS/RMM. This PR transitions cuVS to use `pinned_host_memory_resource`. See rapidsai/rmm#2090 for more information. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Divye Gala (https://github.com/divyegala) URL: rapidsai#1434
1 parent 945f1a8 commit c354e6c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

c/src/core/c_api.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <rmm/mr/device/owning_wrapper.hpp>
3030
#include <rmm/mr/device/per_device_resource.hpp>
3131
#include <rmm/mr/device/pool_memory_resource.hpp>
32-
#include <rmm/mr/host/pinned_memory_resource.hpp>
32+
#include <rmm/mr/pinned_host_memory_resource.hpp>
3333

3434
#include "../core/exceptions.hpp"
3535

@@ -191,12 +191,12 @@ extern "C" cuvsError_t cuvsRMMMemoryResourceReset()
191191
});
192192
}
193193

194-
thread_local std::unique_ptr<rmm::mr::pinned_memory_resource> pinned_mr;
194+
thread_local std::unique_ptr<rmm::mr::pinned_host_memory_resource> pinned_mr;
195195

196196
extern "C" cuvsError_t cuvsRMMHostAlloc(void** ptr, size_t bytes)
197197
{
198198
return cuvs::core::translate_exceptions([=] {
199-
if (pinned_mr == nullptr) { pinned_mr = std::make_unique<rmm::mr::pinned_memory_resource>(); }
199+
if (pinned_mr == nullptr) { pinned_mr = std::make_unique<rmm::mr::pinned_host_memory_resource>(); }
200200
*ptr = pinned_mr->allocate(bytes);
201201
});
202202
}

cpp/src/neighbors/detail/ann_utils.cuh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2022-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
2626
#include <rmm/cuda_stream_view.hpp>
2727
#include <rmm/device_scalar.hpp>
2828
#include <rmm/device_uvector.hpp>
29-
#include <rmm/mr/host/pinned_memory_resource.hpp>
3029
#include <rmm/resource_ref.hpp>
3130

3231
#include <cuda_fp16.hpp>

cpp/src/neighbors/detail/dynamic_batching.cuh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,8 +31,6 @@
3131
#include <cooperative_groups.h>
3232
#include <cuda/atomic>
3333
#include <cuda/std/atomic>
34-
#include <rmm/mr/pinned_host_memory_resource.hpp>
35-
#include <rmm/resource_ref.hpp>
3634

3735
#include <chrono>
3836
#include <limits>

0 commit comments

Comments
 (0)