From a2547f0b97fa2947b1f05bf1287337dc2fd2bf81 Mon Sep 17 00:00:00 2001 From: Mithun RK Date: Wed, 17 Mar 2021 16:22:55 -0700 Subject: [PATCH 1/4] Fix indexing into device_uvector --- cpp/src/rolling/grouped_rolling.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/rolling/grouped_rolling.cu b/cpp/src/rolling/grouped_rolling.cu index c1ebc9f3f9f..f8d1a6e151c 100644 --- a/cpp/src/rolling/grouped_rolling.cu +++ b/cpp/src/rolling/grouped_rolling.cu @@ -127,8 +127,8 @@ std::unique_ptr grouped_rolling_window(table_view const& group_keys, // groups.) // 3. [0, 500, 1000] indicates two equal-sized groups: [0,500), and [500,1000). - assert(group_offsets.size() >= 2 && group_offsets[0] == 0 && - group_offsets[group_offsets.size() - 1] == input.size() && + assert(group_offsets.size() >= 2 && group_offsets.element(0, rmm::cuda_stream_default) == 0 && + group_offsets.element(group_offsets.size() - 1, rmm::cuda_stream_default) == input.size() && "Must have at least one group."); auto preceding_calculator = [d_group_offsets = group_offsets.data(), From 4df64b131e2e983763bcd9fe7b1986603905796f Mon Sep 17 00:00:00 2001 From: Mithun RK Date: Wed, 17 Mar 2021 20:06:54 -0700 Subject: [PATCH 2/4] Code formatting. --- cpp/src/rolling/grouped_rolling.cu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/rolling/grouped_rolling.cu b/cpp/src/rolling/grouped_rolling.cu index f8d1a6e151c..4780525adf3 100644 --- a/cpp/src/rolling/grouped_rolling.cu +++ b/cpp/src/rolling/grouped_rolling.cu @@ -128,7 +128,8 @@ std::unique_ptr grouped_rolling_window(table_view const& group_keys, // 3. [0, 500, 1000] indicates two equal-sized groups: [0,500), and [500,1000). assert(group_offsets.size() >= 2 && group_offsets.element(0, rmm::cuda_stream_default) == 0 && - group_offsets.element(group_offsets.size() - 1, rmm::cuda_stream_default) == input.size() && + group_offsets.element(group_offsets.size() - 1, rmm::cuda_stream_default) == + input.size() && "Must have at least one group."); auto preceding_calculator = [d_group_offsets = group_offsets.data(), From 168d2a098c7820489bcb4bbb7dab4bedcdf460da Mon Sep 17 00:00:00 2001 From: Mithun RK Date: Thu, 18 Mar 2021 12:10:57 -0700 Subject: [PATCH 3/4] Use available stream instead of default. --- cpp/src/rolling/grouped_rolling.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/rolling/grouped_rolling.cu b/cpp/src/rolling/grouped_rolling.cu index 4780525adf3..88253a3f4ea 100644 --- a/cpp/src/rolling/grouped_rolling.cu +++ b/cpp/src/rolling/grouped_rolling.cu @@ -110,8 +110,8 @@ std::unique_ptr grouped_rolling_window(table_view const& group_keys, using sort_groupby_helper = cudf::groupby::detail::sort::sort_groupby_helper; sort_groupby_helper helper{group_keys, cudf::null_policy::INCLUDE, cudf::sorted::YES}; - auto const& group_offsets{helper.group_offsets()}; - auto const& group_labels{helper.group_labels()}; + auto const& group_offsets{helper.group_offsets(stream)}; + auto const& group_labels{helper.group_labels(stream)}; // `group_offsets` are interpreted in adjacent pairs, each pair representing the offsets // of the first, and one past the last elements in a group. @@ -127,8 +127,8 @@ std::unique_ptr grouped_rolling_window(table_view const& group_keys, // groups.) // 3. [0, 500, 1000] indicates two equal-sized groups: [0,500), and [500,1000). - assert(group_offsets.size() >= 2 && group_offsets.element(0, rmm::cuda_stream_default) == 0 && - group_offsets.element(group_offsets.size() - 1, rmm::cuda_stream_default) == + assert(group_offsets.size() >= 2 && group_offsets.element(0, stream) == 0 && + group_offsets.element(group_offsets.size() - 1, stream) == input.size() && "Must have at least one group."); From 17c951f5c3415055ac7d3e2116db3ccae5e213d7 Mon Sep 17 00:00:00 2001 From: Mithun RK Date: Thu, 18 Mar 2021 12:12:31 -0700 Subject: [PATCH 4/4] Code formatting. --- cpp/src/rolling/grouped_rolling.cu | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/src/rolling/grouped_rolling.cu b/cpp/src/rolling/grouped_rolling.cu index 88253a3f4ea..b8cb5e45fec 100644 --- a/cpp/src/rolling/grouped_rolling.cu +++ b/cpp/src/rolling/grouped_rolling.cu @@ -128,8 +128,7 @@ std::unique_ptr grouped_rolling_window(table_view const& group_keys, // 3. [0, 500, 1000] indicates two equal-sized groups: [0,500), and [500,1000). assert(group_offsets.size() >= 2 && group_offsets.element(0, stream) == 0 && - group_offsets.element(group_offsets.size() - 1, stream) == - input.size() && + group_offsets.element(group_offsets.size() - 1, stream) == input.size() && "Must have at least one group."); auto preceding_calculator = [d_group_offsets = group_offsets.data(),