@@ -1126,12 +1126,8 @@ std::pair<rmm::device_uvector<double>, rmm::device_uvector<double>> generate_mer
1126
1126
* `max` of 0.
1127
1127
*
1128
1128
* @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`.
1132
1129
* @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.
1135
1131
* @param group_labels a device iterator of the the group label for each tdigest cluster including
1136
1132
* empty clusters.
1137
1133
* @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
1142
1138
*
1143
1139
* @return A column containing the merged tdigests.
1144
1140
*/
1145
- template <typename HGroupOffsetIter, typename GroupOffsetIter, typename GroupLabelIter>
1141
+ template <typename GroupOffsetIter, typename GroupLabelIter>
1146
1142
std::unique_ptr<column> merge_tdigests (tdigest_column_view const & tdv,
1147
- HGroupOffsetIter h_group_offsets,
1148
1143
GroupOffsetIter group_offsets,
1149
1144
GroupLabelIter group_labels,
1150
1145
size_t num_group_labels,
@@ -1313,21 +1308,13 @@ std::unique_ptr<scalar> reduce_merge_tdigest(column_view const& input,
1313
1308
1314
1309
if (input.size () == 0 ) { return cudf::tdigest::detail::make_empty_tdigest_scalar (stream, mr); }
1315
1310
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);
1331
1318
}
1332
1319
1333
1320
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,
1376
1363
return cudf::tdigest::detail::make_empty_tdigests_column (num_groups, stream, mr);
1377
1364
}
1378
1365
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
-
1387
1366
return merge_tdigests (tdv,
1388
- h_group_offsets.begin (),
1389
1367
group_offsets.data (),
1390
1368
group_labels.data (),
1391
1369
group_labels.size (),
0 commit comments