From f931d43afe1310a515da6ecd7fd372607ad66b2d Mon Sep 17 00:00:00 2001 From: Nghia Truong Date: Thu, 7 Mar 2024 17:48:09 -0800 Subject: [PATCH] Remove constructor using two size parameters Signed-off-by: Nghia Truong --- cpp/src/io/utilities/hostdevice_vector.hpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/cpp/src/io/utilities/hostdevice_vector.hpp b/cpp/src/io/utilities/hostdevice_vector.hpp index 94df4a6934e..669e0b8ffd1 100644 --- a/cpp/src/io/utilities/hostdevice_vector.hpp +++ b/cpp/src/io/utilities/hostdevice_vector.hpp @@ -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{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(); }