Skip to content

Commit

Permalink
Pass std::optional instead of thrust::optional to RMM (#2199)
Browse files Browse the repository at this point in the history
Update `thrust::optional` to `std::optional` to align with rapidsai/rmm#1464.

Authors:
  - Paul Taylor (https://github.com/trxcllnt)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Mark Harris (https://github.com/harrism)

URL: #2199
  • Loading branch information
trxcllnt authored Feb 27, 2024
1 parent 9fb05a2 commit da22f2f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cpp/include/raft/core/device_resources_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <rmm/cuda_stream_pool.hpp>
#include <rmm/mr/device/cuda_memory_resource.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <thrust/optional.h>

namespace raft {

/**
Expand Down Expand Up @@ -116,11 +116,11 @@ struct device_resources_manager {
// this initial size for the pool in bytes. Must be a multiple of 256.
// If nullopt, use half of the available memory on the current
// device.
thrust::optional<std::size_t> init_mem_pool_size{thrust::nullopt};
std::optional<std::size_t> init_mem_pool_size{std::nullopt};
// If set to any non-zero value, create a memory pool with this
// maximum size. If nullopt, use up to the entire available memory of the
// device
thrust::optional<std::size_t> max_mem_pool_size{std::size_t{}};
std::optional<std::size_t> max_mem_pool_size{std::size_t{}};
// Limit on workspace memory for the returned device_resources object
std::optional<std::size_t> workspace_allocation_limit{std::nullopt};
// Optional specification of separate workspace memory resources for each
Expand Down Expand Up @@ -360,7 +360,7 @@ struct device_resources_manager {
if (memory_limit) {
params_.max_mem_pool_size.emplace(*memory_limit);
} else {
params_.max_mem_pool_size = thrust::nullopt;
params_.max_mem_pool_size = std::nullopt;
}
}
}
Expand All @@ -377,7 +377,7 @@ struct device_resources_manager {
if (init_memory) {
params_.init_mem_pool_size.emplace(*init_memory);
} else {
params_.init_mem_pool_size = thrust::nullopt;
params_.init_mem_pool_size = std::nullopt;
}
}
}
Expand Down

0 comments on commit da22f2f

Please sign in to comment.