From a778a8dfd576850bf04967a9eff9b6b9ac2a4c7f Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Wed, 20 Mar 2024 03:20:10 +0000 Subject: [PATCH 1/9] fix for libcudf examples --- cpp/examples/strings/common.hpp | 2 +- cpp/examples/strings/custom_optimized.cu | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cpp/examples/strings/common.hpp b/cpp/examples/strings/common.hpp index 0dbe6fe2b7b..ea433a600d7 100644 --- a/cpp/examples/strings/common.hpp +++ b/cpp/examples/strings/common.hpp @@ -110,7 +110,7 @@ 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"; + std::cout << "Output size " << result->view().size() << " 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(); From 183dad4f9560c0a95e37d4e2802aa428c92d8272 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Wed, 20 Mar 2024 18:03:27 +0000 Subject: [PATCH 2/9] suggested changes from PR review --- cpp/examples/basic/src/process_csv.cpp | 3 +++ cpp/examples/strings/common.hpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index 0d2b6b099ac..4d5b80fe787 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -92,6 +92,9 @@ int main(int argc, char** argv) // memory resource. rmm::mr::set_current_device_resource(&mr); + // for testing the CI. + i_am_a_dummy_compile_time_error; + // Read data auto stock_table_with_metadata = read_csv("4stock_5day.csv"); diff --git a/cpp/examples/strings/common.hpp b/cpp/examples/strings/common.hpp index ea433a600d7..6bde93f5d0e 100644 --- a/cpp/examples/strings/common.hpp +++ b/cpp/examples/strings/common.hpp @@ -110,7 +110,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().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; } From cb93eec5e410d892777c7b16504f68f71e4286ce Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Fri, 22 Mar 2024 20:33:28 +0000 Subject: [PATCH 3/9] adding pipefail to build.sh --- cpp/examples/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/examples/build.sh b/cpp/examples/build.sh index 001cdeec694..8b88b42b59b 100755 --- a/cpp/examples/build.sh +++ b/cpp/examples/build.sh @@ -4,6 +4,8 @@ # libcudf examples build script +set -euo pipefail + # Parallelism control PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} From 68edc7a6e4fbecf2cb675951d065bee0f8dff336 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:35:25 -0700 Subject: [PATCH 4/9] Including strings_column_view header Including strings_column_view header to fix build error --- cpp/examples/strings/common.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/examples/strings/common.hpp b/cpp/examples/strings/common.hpp index 6bde93f5d0e..65a9c100c7c 100644 --- a/cpp/examples/strings/common.hpp +++ b/cpp/examples/strings/common.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include From 73a4e0a2a1bbbc71fd2bcc5200fc07685a71fd2a Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com> Date: Wed, 3 Apr 2024 01:25:15 -0700 Subject: [PATCH 5/9] Update cpp/examples/basic/src/process_csv.cpp Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com> --- cpp/examples/basic/src/process_csv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index 4d5b80fe787..36c07d7e3e6 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -93,7 +93,7 @@ int main(int argc, char** argv) rmm::mr::set_current_device_resource(&mr); // for testing the CI. - i_am_a_dummy_compile_time_error; + #error "Force compilation error to test CI" // Read data auto stock_table_with_metadata = read_csv("4stock_5day.csv"); From 96a7d8abf6eee6365d0e32629e2f0ad15114b68a Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:55:50 -0700 Subject: [PATCH 6/9] Update cpp/examples/basic/src/process_csv.cpp Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com> --- cpp/examples/basic/src/process_csv.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index 36c07d7e3e6..d1ee29d641c 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -92,7 +92,6 @@ int main(int argc, char** argv) // memory resource. rmm::mr::set_current_device_resource(&mr); - // for testing the CI. #error "Force compilation error to test CI" // Read data From 323e4607a00a93fe5abfd8111c6ac69c3acff964 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Mon, 8 Apr 2024 19:04:26 +0000 Subject: [PATCH 7/9] minor clang-format fix --- cpp/examples/basic/src/process_csv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index d1ee29d641c..fea1efdb9da 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -92,7 +92,7 @@ int main(int argc, char** argv) // memory resource. rmm::mr::set_current_device_resource(&mr); - #error "Force compilation error to test CI" +#error "Force compilation error to test CI" // Read data auto stock_table_with_metadata = read_csv("4stock_5day.csv"); From 2acdf31b04526b3fcfd9dd27915ce217d80710b7 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Mon, 8 Apr 2024 23:30:25 +0000 Subject: [PATCH 8/9] minor copyright fix --- cpp/examples/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/examples/build.sh b/cpp/examples/build.sh index 8b88b42b59b..424da35ad18 100755 --- a/cpp/examples/build.sh +++ b/cpp/examples/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # libcudf examples build script From dfd9be4cbac8c2c553f0aed9fc5b4c9e04f44d77 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Date: Tue, 9 Apr 2024 01:51:55 +0000 Subject: [PATCH 9/9] removing the CI #error --- cpp/examples/basic/src/process_csv.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index fea1efdb9da..0d2b6b099ac 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -92,8 +92,6 @@ int main(int argc, char** argv) // memory resource. rmm::mr::set_current_device_resource(&mr); -#error "Force compilation error to test CI" - // Read data auto stock_table_with_metadata = read_csv("4stock_5day.csv");