Skip to content

Commit

Permalink
Opt in, rather than opt out
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Oct 1, 2024
1 parent 88444f0 commit 06fc222
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/src/reductions/compound.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <cudf/dictionary/detail/iterator.cuh>
#include <cudf/reduction/detail/reduction.cuh>
#include <cudf/reduction/detail/reduction_operators.cuh>
#include <cudf/scalar/scalar_factories.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/utilities/memory_resource.hpp>
Expand Down Expand Up @@ -59,9 +60,9 @@ std::unique_ptr<scalar> compound_reduction(column_view const& col,

// All null input produces all null output
if (valid_count == 0 ||
// Don't care about ddof argument of mean. For variance and
// standard deviation must have more valid entries than ddof.
!std::is_same_v<Op, cudf::reduction::detail::op::mean> && valid_count <= ddof) {
// Only care about ddof for standard deviation and variance right now
valid_count <= ddof && (std::is_same_v<Op, cudf::reduction::detail::op::standard_deviation> ||
std::is_same_v<Op, cudf::reduction::detail::op::variance>)) {
auto result = cudf::make_fixed_width_scalar(output_dtype, stream, mr);
result->set_valid_async(false, stream);
return result;
Expand Down

0 comments on commit 06fc222

Please sign in to comment.