Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_pool_memory_resource return type #1483

Closed
Closed
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
5 changes: 3 additions & 2 deletions cpp/include/raft/util/memory_pool-ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
#include <cstddef> // size_t
#include <memory> // std::unique_ptr
#include <rmm/mr/device/device_memory_resource.hpp> // rmm::mr::device_memory_resource
#include <rmm/mr/device/pool_memory_resource.hpp> // rmm::mr::pool_memory_resource

namespace raft {

std::unique_ptr<rmm::mr::device_memory_resource> get_pool_memory_resource(
rmm::mr::device_memory_resource*& mr, size_t initial_size);
std::unique_ptr<rmm::mr::pool_memory_resource<rmm::mr::device_memory_resource>>
get_pool_memory_resource(rmm::mr::device_memory_resource*& mr, size_t initial_size);

} // namespace raft
5 changes: 3 additions & 2 deletions cpp/include/raft/util/memory_pool-inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ namespace raft {
* @return if a new memory pool is created, it returns a unique_ptr to it;
* this managed pointer controls the lifetime of the created memory resource.
*/
RAFT_INLINE_CONDITIONAL std::unique_ptr<rmm::mr::device_memory_resource> get_pool_memory_resource(
rmm::mr::device_memory_resource*& mr, size_t initial_size)
RAFT_INLINE_CONDITIONAL
std::unique_ptr<rmm::mr::pool_memory_resource<rmm::mr::device_memory_resource>>
get_pool_memory_resource(rmm::mr::device_memory_resource*& mr, size_t initial_size)
{
using pool_res_t = rmm::mr::pool_memory_resource<rmm::mr::device_memory_resource>;
std::unique_ptr<pool_res_t> pool_res{};
Expand Down