51
51
52
52
#include < rmm/cuda_stream_view.hpp>
53
53
#include < rmm/exec_policy.hpp>
54
+ #include < rmm/resource_ref.hpp>
54
55
55
56
#include < cuda/std/climits>
56
57
#include < cuda/std/limits>
@@ -453,7 +454,10 @@ struct DeviceRollingRowNumber {
453
454
454
455
struct agg_specific_empty_output {
455
456
template <typename InputType, aggregation::Kind op>
456
- std::unique_ptr<column> operator ()(column_view const & input, rolling_aggregation const &) const
457
+ std::unique_ptr<column> operator ()(column_view const & input,
458
+ rolling_aggregation const &,
459
+ rmm::cuda_stream_view stream,
460
+ rmm::device_async_resource_ref mr) const
457
461
{
458
462
using target_type = cudf::detail::target_type_t <InputType, op>;
459
463
@@ -467,15 +471,18 @@ struct agg_specific_empty_output {
467
471
468
472
if constexpr (op == aggregation::COLLECT_LIST) {
469
473
return cudf::make_lists_column (
470
- 0 , make_empty_column (type_to_id<size_type>()), empty_like (input), 0 , {});
474
+ 0 , make_empty_column (type_to_id<size_type>()), empty_like (input), 0 , {}, stream, mr );
471
475
}
472
476
473
477
return empty_like (input);
474
478
}
475
479
};
476
480
477
- static std::unique_ptr<column> empty_output_for_rolling_aggregation (column_view const & input,
478
- rolling_aggregation const & agg)
481
+ static std::unique_ptr<column> empty_output_for_rolling_aggregation (
482
+ column_view const & input,
483
+ rolling_aggregation const & agg,
484
+ rmm::cuda_stream_view stream,
485
+ rmm::device_async_resource_ref mr)
479
486
{
480
487
// TODO:
481
488
// Ideally, for UDF aggregations, the returned column would match
@@ -490,7 +497,7 @@ static std::unique_ptr<column> empty_output_for_rolling_aggregation(column_view
490
497
return agg.kind == aggregation::CUDA || agg.kind == aggregation::PTX
491
498
? empty_like (input)
492
499
: cudf::detail::dispatch_type_and_aggregation (
493
- input.type (), agg.kind , agg_specific_empty_output{}, input, agg);
500
+ input.type (), agg.kind , agg_specific_empty_output{}, input, agg, stream, mr );
494
501
}
495
502
496
503
/* *
@@ -1326,7 +1333,9 @@ std::unique_ptr<column> rolling_window(column_view const& input,
1326
1333
static_assert (warp_size == cudf::detail::size_in_bits<cudf::bitmask_type>(),
1327
1334
" bitmask_type size does not match CUDA warp size" );
1328
1335
1329
- if (input.is_empty ()) { return cudf::detail::empty_output_for_rolling_aggregation (input, agg); }
1336
+ if (input.is_empty ()) {
1337
+ return cudf::detail::empty_output_for_rolling_aggregation (input, agg, stream, mr);
1338
+ }
1330
1339
1331
1340
if (cudf::is_dictionary (input.type ())) {
1332
1341
CUDF_EXPECTS (agg.kind == aggregation::COUNT_ALL || agg.kind == aggregation::COUNT_VALID ||
0 commit comments