diff --git a/cpp/examples/build.sh b/cpp/examples/build.sh index 001cdeec694..424da35ad18 100755 --- a/cpp/examples/build.sh +++ b/cpp/examples/build.sh @@ -1,9 +1,11 @@ #!/bin/bash -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # libcudf examples build script +set -euo pipefail + # Parallelism control PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} diff --git a/cpp/examples/strings/common.hpp b/cpp/examples/strings/common.hpp index 0dbe6fe2b7b..65a9c100c7c 100644 --- a/cpp/examples/strings/common.hpp +++ b/cpp/examples/strings/common.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,8 @@ int main(int argc, char const** argv) std::chrono::duration elapsed = std::chrono::steady_clock::now() - st; std::cout << "Wall time: " << elapsed.count() << " seconds\n"; - std::cout << "Output size " << result->view().child(1).size() << " bytes\n"; + auto const scv = cudf::strings_column_view(result->view()); + std::cout << "Output size " << scv.chars_size(rmm::cuda_stream_default) << " bytes\n"; return 0; } diff --git a/cpp/examples/strings/custom_optimized.cu b/cpp/examples/strings/custom_optimized.cu index cefa3346150..62ca19a5ca9 100644 --- a/cpp/examples/strings/custom_optimized.cu +++ b/cpp/examples/strings/custom_optimized.cu @@ -153,8 +153,12 @@ std::unique_ptr redact_strings(cudf::column_view const& names, redact_kernel<<>>( *d_names, *d_visibilities, offsets.data(), chars.data()); - // create column from offsets and chars vectors (no copy is performed) - auto result = cudf::make_strings_column(names.size(), std::move(offsets), chars.release(), {}, 0); + // create column from offsets vector (move only) + auto offsets_column = std::make_unique(std::move(offsets), rmm::device_buffer{}, 0); + + // create column for chars vector (no copy is performed) + auto result = cudf::make_strings_column( + names.size(), std::move(offsets_column), chars.release(), 0, rmm::device_buffer{}); // wait for all of the above to finish stream.synchronize();