Skip to content

Commit b75036b

Browse files
authored
Remove unused variable in internal merge_tdigests utility (#17151)
Removes unused variable that contains host copy of the group_offsets data. This host variable appears to have been made obsolete by a combination of #16897 and #16780 Found while working on #17149 Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Muhammad Haseeb (https://github.com/mhaseeb123) - Nghia Truong (https://github.com/ttnghia) URL: #17151
1 parent 3a62314 commit b75036b

File tree

1 file changed

+9
-31
lines changed

1 file changed

+9
-31
lines changed

cpp/src/quantiles/tdigest/tdigest_aggregation.cu

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,12 +1126,8 @@ std::pair<rmm::device_uvector<double>, rmm::device_uvector<double>> generate_mer
11261126
* `max` of 0.
11271127
*
11281128
* @param tdv input tdigests. The tdigests within this column are grouped by key.
1129-
* @param h_group_offsets a host iterator of the offsets to the start of each group. A group is
1130-
* counted as one even when the cluster is empty in it. The offsets should have the same values as
1131-
* the ones in `group_offsets`.
11321129
* @param group_offsets a device iterator of the offsets to the start of each group. A group is
1133-
* counted as one even when the cluster is empty in it. The offsets should have the same values as
1134-
* the ones in `h_group_offsets`.
1130+
* counted as one even when the cluster is empty in it.
11351131
* @param group_labels a device iterator of the the group label for each tdigest cluster including
11361132
* empty clusters.
11371133
* @param num_group_labels the number of unique group labels.
@@ -1142,9 +1138,8 @@ std::pair<rmm::device_uvector<double>, rmm::device_uvector<double>> generate_mer
11421138
*
11431139
* @return A column containing the merged tdigests.
11441140
*/
1145-
template <typename HGroupOffsetIter, typename GroupOffsetIter, typename GroupLabelIter>
1141+
template <typename GroupOffsetIter, typename GroupLabelIter>
11461142
std::unique_ptr<column> merge_tdigests(tdigest_column_view const& tdv,
1147-
HGroupOffsetIter h_group_offsets,
11481143
GroupOffsetIter group_offsets,
11491144
GroupLabelIter group_labels,
11501145
size_t num_group_labels,
@@ -1313,21 +1308,13 @@ std::unique_ptr<scalar> reduce_merge_tdigest(column_view const& input,
13131308

13141309
if (input.size() == 0) { return cudf::tdigest::detail::make_empty_tdigest_scalar(stream, mr); }
13151310

1316-
auto group_offsets_ = group_offsets_fn{input.size()};
1317-
auto h_group_offsets = cudf::detail::make_counting_transform_iterator(0, group_offsets_);
1318-
auto group_offsets = cudf::detail::make_counting_transform_iterator(0, group_offsets_);
1319-
auto group_labels = thrust::make_constant_iterator(0);
1320-
return to_tdigest_scalar(merge_tdigests(tdv,
1321-
h_group_offsets,
1322-
group_offsets,
1323-
group_labels,
1324-
input.size(),
1325-
1,
1326-
max_centroids,
1327-
stream,
1328-
mr),
1329-
stream,
1330-
mr);
1311+
auto group_offsets_ = group_offsets_fn{input.size()};
1312+
auto group_offsets = cudf::detail::make_counting_transform_iterator(0, group_offsets_);
1313+
auto group_labels = thrust::make_constant_iterator(0);
1314+
return to_tdigest_scalar(
1315+
merge_tdigests(tdv, group_offsets, group_labels, input.size(), 1, max_centroids, stream, mr),
1316+
stream,
1317+
mr);
13311318
}
13321319

13331320
std::unique_ptr<column> group_tdigest(column_view const& col,
@@ -1376,16 +1363,7 @@ std::unique_ptr<column> group_merge_tdigest(column_view const& input,
13761363
return cudf::tdigest::detail::make_empty_tdigests_column(num_groups, stream, mr);
13771364
}
13781365

1379-
// bring group offsets back to the host
1380-
std::vector<size_type> h_group_offsets(group_offsets.size());
1381-
cudaMemcpyAsync(h_group_offsets.data(),
1382-
group_offsets.begin(),
1383-
sizeof(size_type) * group_offsets.size(),
1384-
cudaMemcpyDefault,
1385-
stream);
1386-
13871366
return merge_tdigests(tdv,
1388-
h_group_offsets.begin(),
13891367
group_offsets.data(),
13901368
group_labels.data(),
13911369
group_labels.size(),

0 commit comments

Comments
 (0)