From 018696cb2d3b6d5aae7fe87077a37712b04a4cd4 Mon Sep 17 00:00:00 2001 From: AtlantaPepsi Date: Thu, 5 May 2022 22:54:40 -0400 Subject: [PATCH 1/8] removed mr parameter (temporary) from inplace bitmask operations --- cpp/include/cudf/detail/null_mask.cuh | 7 +++---- cpp/src/bitmask/null_mask.cu | 6 ++---- cpp/src/structs/utilities.cpp | 3 +-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index 6a6cdd43004..8ffa8184493 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -130,8 +130,7 @@ std::pair bitmask_binop( masks, masks_begin_bits, mask_size_bits, - stream, - mr); + stream); return std::pair(std::move(dest_mask), null_count); } @@ -156,8 +155,7 @@ size_type inplace_bitmask_binop( host_span masks, host_span masks_begin_bits, size_type mask_size_bits, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream) { CUDF_EXPECTS( std::all_of(masks_begin_bits.begin(), masks_begin_bits.end(), [](auto b) { return b >= 0; }), @@ -166,6 +164,7 @@ size_type inplace_bitmask_binop( CUDF_EXPECTS(std::all_of(masks.begin(), masks.end(), [](auto p) { return p != nullptr; }), "Mask pointer cannot be null"); + rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) rmm::device_scalar d_counter{0, stream, mr}; rmm::device_uvector d_masks(masks.size(), stream, mr); rmm::device_uvector d_begin_bits(masks_begin_bits.size(), stream, mr); diff --git a/cpp/src/bitmask/null_mask.cu b/cpp/src/bitmask/null_mask.cu index ec14f8e6ded..e11e13e28da 100644 --- a/cpp/src/bitmask/null_mask.cu +++ b/cpp/src/bitmask/null_mask.cu @@ -408,8 +408,7 @@ cudf::size_type inplace_bitmask_and(device_span dest_mask, host_span masks, host_span begin_bits, size_type mask_size, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::cuda_stream_view stream) { return inplace_bitmask_binop( [] __device__(bitmask_type left, bitmask_type right) { return left & right; }, @@ -417,8 +416,7 @@ cudf::size_type inplace_bitmask_and(device_span dest_mask, masks, begin_bits, mask_size, - stream, - mr); + stream); } // Bitwise AND of the masks diff --git a/cpp/src/structs/utilities.cpp b/cpp/src/structs/utilities.cpp index 5baab0f09a2..ecdb0d71728 100644 --- a/cpp/src/structs/utilities.cpp +++ b/cpp/src/structs/utilities.cpp @@ -328,8 +328,7 @@ void superimpose_parent_nulls(bitmask_type const* parent_null_mask, masks, begin_bits, child.size(), - stream, - mr); + stream); auto const null_count = child.size() - valid_count; child.set_null_count(null_count); } From 6215ff946f6eb444a5fec79d92c6c33d48aaab62 Mon Sep 17 00:00:00 2001 From: Karthikeyan <6488848+karthikeyann@users.noreply.github.com> Date: Fri, 6 May 2022 15:28:14 +0530 Subject: [PATCH 2/8] semicolon fix. --- cpp/include/cudf/detail/null_mask.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index 8ffa8184493..ac9bac7a3f6 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -164,7 +164,7 @@ size_type inplace_bitmask_binop( CUDF_EXPECTS(std::all_of(masks.begin(), masks.end(), [](auto p) { return p != nullptr; }), "Mask pointer cannot be null"); - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource(); rmm::device_scalar d_counter{0, stream, mr}; rmm::device_uvector d_masks(masks.size(), stream, mr); rmm::device_uvector d_begin_bits(masks_begin_bits.size(), stream, mr); From 95e99ce6f114f1b09d755c8a62ccf72bfa4e639b Mon Sep 17 00:00:00 2001 From: AtlantaPepsi Date: Sat, 14 May 2022 15:59:49 -0400 Subject: [PATCH 3/8] format & docs fix --- cpp/include/cudf/detail/null_mask.cuh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index ac9bac7a3f6..425aed69f1e 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -126,7 +126,7 @@ std::pair bitmask_binop( mask_size_bits - inplace_bitmask_binop(op, device_span(static_cast(dest_mask.data()), - num_bitmask_words(mask_size_bits)), + num_bitmask_words(mask_size_bits)), masks, masks_begin_bits, mask_size_bits, @@ -145,7 +145,6 @@ std::pair bitmask_binop( * @param[in] masks_begin_bits The bit offsets from which each mask is to be merged * @param[in] mask_size_bits The number of bits to be ANDed in each mask * @param[in] stream CUDA stream used for device memory operations and kernel launches - * @param[in] mr Device memory resource used to allocate the returned device_buffer * @return size_type Count of set bits */ template From e7686c871fc029c9f78f51f4767c521362f0a59e Mon Sep 17 00:00:00 2001 From: AtlantaPepsi Date: Sat, 14 May 2022 20:47:58 -0400 Subject: [PATCH 4/8] fixing format & missed headers --- cpp/include/cudf/detail/null_mask.cuh | 10 +++++----- cpp/include/cudf/detail/null_mask.hpp | 3 +-- cpp/src/reductions/simple_segmented.cuh | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index 425aed69f1e..2b767e30605 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -126,11 +126,11 @@ std::pair bitmask_binop( mask_size_bits - inplace_bitmask_binop(op, device_span(static_cast(dest_mask.data()), - num_bitmask_words(mask_size_bits)), - masks, - masks_begin_bits, - mask_size_bits, - stream); + num_bitmask_words(mask_size_bits)), + masks, + masks_begin_bits, + mask_size_bits, + stream); return std::pair(std::move(dest_mask), null_count); } diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index 83ef78a8250..48e939838fd 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -275,8 +275,7 @@ cudf::size_type inplace_bitmask_and( host_span masks, host_span masks_begin_bits, size_type mask_size_bits, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream); } // namespace detail diff --git a/cpp/src/reductions/simple_segmented.cuh b/cpp/src/reductions/simple_segmented.cuh index 7796794502d..80b9946bfc9 100644 --- a/cpp/src/reductions/simple_segmented.cuh +++ b/cpp/src/reductions/simple_segmented.cuh @@ -196,8 +196,7 @@ std::unique_ptr string_segmented_reduction(column_view const& col, masks, begin_bits, result->size(), - stream, - mr); + stream); result->set_null_count(result->size() - valid_count); } } From 90e925913ace1cf834d262131d9daa5655e5bd91 Mon Sep 17 00:00:00 2001 From: AtlantaPepsi Date: Sat, 14 May 2022 21:08:17 -0400 Subject: [PATCH 5/8] final format fix --- cpp/include/cudf/detail/null_mask.cuh | 21 ++++++++++----------- cpp/include/cudf/detail/null_mask.hpp | 11 +++++------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index 2b767e30605..b452a7f2beb 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -127,10 +127,10 @@ std::pair bitmask_binop( inplace_bitmask_binop(op, device_span(static_cast(dest_mask.data()), num_bitmask_words(mask_size_bits)), - masks, - masks_begin_bits, - mask_size_bits, - stream); + masks, + masks_begin_bits, + mask_size_bits, + stream); return std::pair(std::move(dest_mask), null_count); } @@ -148,13 +148,12 @@ std::pair bitmask_binop( * @return size_type Count of set bits */ template -size_type inplace_bitmask_binop( - Binop op, - device_span dest_mask, - host_span masks, - host_span masks_begin_bits, - size_type mask_size_bits, - rmm::cuda_stream_view stream) +size_type inplace_bitmask_binop(Binop op, + device_span dest_mask, + host_span masks, + host_span masks_begin_bits, + size_type mask_size_bits, + rmm::cuda_stream_view stream) { CUDF_EXPECTS( std::all_of(masks_begin_bits.begin(), masks_begin_bits.end(), [](auto b) { return b >= 0; }), diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index 48e939838fd..ac255068ef1 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -270,12 +270,11 @@ std::pair bitmask_or( * @param mr Device memory resource used to allocate the returned device_buffer * @return Count of set bits */ -cudf::size_type inplace_bitmask_and( - device_span dest_mask, - host_span masks, - host_span masks_begin_bits, - size_type mask_size_bits, - rmm::cuda_stream_view stream); +cudf::size_type inplace_bitmask_and(device_span dest_mask, + host_span masks, + host_span masks_begin_bits, + size_type mask_size_bits, + rmm::cuda_stream_view stream); } // namespace detail From da1065333a50d6b9c3e2b5c9bd6cea137266a403 Mon Sep 17 00:00:00 2001 From: AtlantaPepsi Date: Sat, 14 May 2022 21:18:53 -0400 Subject: [PATCH 6/8] copyright info ... --- cpp/include/cudf/detail/null_mask.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index ac255068ef1..c4d169e4abe 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 385b1692309d983749b93a53a77a44d9d1c9f5b7 Mon Sep 17 00:00:00 2001 From: Tim <43156029+AtlantaPepsi@users.noreply.github.com> Date: Mon, 16 May 2022 10:14:45 -0400 Subject: [PATCH 7/8] fixing copyright year Co-authored-by: Yunsong Wang --- cpp/include/cudf/detail/null_mask.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index c4d169e4abe..a82a9465190 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From be77d99c8b31930a08be14e183fdedff7098b459 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 17 May 2022 17:54:14 -0400 Subject: [PATCH 8/8] Update cpp/include/cudf/detail/null_mask.hpp Co-authored-by: Karthikeyan <6488848+karthikeyann@users.noreply.github.com> --- cpp/include/cudf/detail/null_mask.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index a82a9465190..b5f46750469 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -267,7 +267,6 @@ std::pair bitmask_or( * @param masks_begin_bits The bit offsets from which each mask is to be ANDed * @param mask_size_bits The number of bits to be ANDed in each mask * @param stream CUDA stream used for device memory operations and kernel launches - * @param mr Device memory resource used to allocate the returned device_buffer * @return Count of set bits */ cudf::size_type inplace_bitmask_and(device_span dest_mask,