Skip to content

Commit

Permalink
Remove constructor using two size parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia committed Mar 8, 2024
1 parent eac0d51 commit f931d43
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions cpp/src/io/utilities/hostdevice_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ class hostdevice_vector {
hostdevice_vector() : hostdevice_vector(0, cudf::get_default_stream()) {}

explicit hostdevice_vector(size_t size, rmm::cuda_stream_view stream)
: hostdevice_vector(size, size, stream)
: h_data{size, rmm_host_allocator<T>{cudf::io::get_host_memory_resource(), stream}},
d_data{size, stream}
{
}

explicit hostdevice_vector(size_t initial_size, size_t max_size, rmm::cuda_stream_view stream)
: h_data({cudf::io::get_host_memory_resource(), stream}), d_data(0, stream)
{
CUDF_EXPECTS(initial_size <= max_size, "initial_size cannot be larger than max_size");

h_data.reserve(max_size);
h_data.resize(initial_size);

d_data.resize(max_size, stream);
}

[[nodiscard]] size_t capacity() const noexcept { return d_data.size(); }
[[nodiscard]] size_t size() const noexcept { return h_data.size(); }
[[nodiscard]] size_t size_bytes() const noexcept { return sizeof(T) * size(); }
Expand Down

0 comments on commit f931d43

Please sign in to comment.