Skip to content

Commit

Permalink
Use Default Memory Resource for Temporaries in reduction.cpp (#9344)
Browse files Browse the repository at this point in the history
This PR replaces the memory resource for temporaries in `reduction.cpp` with default memory resources.

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Bradley Dice (https://github.com/bdice)
  - MithunR (https://github.com/mythrocks)

URL: #9344
  • Loading branch information
isVoid authored Sep 30, 2021
1 parent 5cea6b5 commit ffb3814
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cpp/src/reductions/reductions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,25 @@ struct reduce_dispatch_functor {
return reduction::standard_deviation(col, output_dtype, var_agg->_ddof, stream, mr);
} break;
case aggregation::MEDIAN: {
auto sorted_indices = sorted_order(table_view{{col}}, {}, {null_order::AFTER}, stream, mr);
auto sorted_indices = sorted_order(table_view{{col}}, {}, {null_order::AFTER}, stream);
auto valid_sorted_indices = split(*sorted_indices, {col.size() - col.null_count()})[0];
auto col_ptr =
quantile(col, {0.5}, interpolation::LINEAR, valid_sorted_indices, true, stream, mr);
quantile(col, {0.5}, interpolation::LINEAR, valid_sorted_indices, true, stream);
return get_element(*col_ptr, 0, stream, mr);
} break;
case aggregation::QUANTILE: {
auto quantile_agg = dynamic_cast<quantile_aggregation const*>(agg.get());
CUDF_EXPECTS(quantile_agg->_quantiles.size() == 1,
"Reduction quantile accepts only one quantile value");
auto sorted_indices = sorted_order(table_view{{col}}, {}, {null_order::AFTER}, stream, mr);
auto sorted_indices = sorted_order(table_view{{col}}, {}, {null_order::AFTER}, stream);
auto valid_sorted_indices = split(*sorted_indices, {col.size() - col.null_count()})[0];

auto col_ptr = quantile(col,
quantile_agg->_quantiles,
quantile_agg->_interpolation,
valid_sorted_indices,
true,
stream,
mr);
stream);
return get_element(*col_ptr, 0, stream, mr);
} break;
case aggregation::NUNIQUE: {
Expand Down

0 comments on commit ffb3814

Please sign in to comment.