From 0c735e76e991cabe2d3780ffd3fd328310e23cdf Mon Sep 17 00:00:00 2001 From: David Wendt Date: Mon, 12 Aug 2024 13:40:30 -0400 Subject: [PATCH] pass string-view instead of scalar-device-view --- cpp/src/column/column_factories.cu | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/src/column/column_factories.cu b/cpp/src/column/column_factories.cu index d6e8f3d039c..92e2ed6a384 100644 --- a/cpp/src/column/column_factories.cu +++ b/cpp/src/column/column_factories.cu @@ -67,17 +67,17 @@ std::unique_ptr column_from_scalar_dispatch::operator() const&>(value); - auto const sdv = cudf::get_scalar_device_view(const_cast(ss)); + auto& ss = static_cast const&>(value); + auto const d_str = ss.value(stream); // no actual data is copied // fill the column with the scalar - using sip_t = cudf::strings::detail::string_index_pair; - rmm::device_uvector indices(size, stream); + rmm::device_uvector indices(size, stream); thrust::generate( - rmm::exec_policy_nosync(stream), indices.begin(), indices.end(), [sdv] __device__() { - auto const d_str = sdv.value(); + rmm::exec_policy_nosync(stream), indices.begin(), indices.end(), [d_str] __device__() { // special handling for empty string -- from an all-empty strings column - return d_str.empty() ? sip_t{"", 0} : sip_t{d_str.data(), d_str.size_bytes()}; + return d_str.empty() + ? cudf::strings::detail::string_index_pair{"", 0} + : cudf::strings::detail::string_index_pair{d_str.data(), d_str.size_bytes()}; }); return cudf::strings::detail::make_strings_column(indices.begin(), indices.end(), stream, mr); }